• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 338
  • Last Modified:

List all articles in Joomla

I am trying to have all my articles listed on a page in Joomla as is done on this page:

http://www.paydayloans.co.uk/news/index.html

exactly the same style...

I have tried using the menu manager with the various options but they are all the wrong format...
0
Everlearner
Asked:
Everlearner
  • 6
  • 5
  • 2
1 Solution
 
teomcamCommented:
0
 
Andrew DerseIT ManagerCommented:
This is something you can custom code into Joomla.

Are you familiar with PHP and MySQL?

If so, I can create a procedure and provide you with the code to develop this page.
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
EverlearnerAuthor Commented:
HI there, yeah I am familiar  with php and mysql, I'm unfamiliar with joomla though... that will be great if you could thanks!
0
 
Andrew DerseIT ManagerCommented:
Alright, the first step you will need to do is download and install this extension:  (Jumi)
http://extensions.joomla.org/extensions/edition/custom-code-in-content/1023?qh=YToxOntpOjA7czo0OiJqdW1pIjt9

Jumi will allow you to write custom code into your Joomla pages.

While you are doing that I will come up with the code to display all of the articles for you.
0
 
Andrew DerseIT ManagerCommented:
Alright so here's how to accomplish what you need:

1) Download and install Jumi component.
2) Copy and paste this code in your favorite php/html editor: (Make sure to change the database connection variables...

 
<?php 

$con = mysql_connect("localhost(change as needed)","root(change as needed)","***********(Change as needed)");
 if (!$con)
   {
   die('Could not connect: ' . mysql_error());
   }
 
mysql_select_db("j15", $con);

$query=mysql_query("SELECT * FROM jos_content order by title ASC");
while($row = mysql_fetch_array($query)) {
$article_id = $row['id'];
$title = $row['title'];
$alias = $row['alias'];
$published = $row['publish_up'];
$published_clean = preg_split('/ /', $published);
$published_clean = preg_split('/-/',$published_clean[0]);

$date2 = date("D, d M Y", mktime(0, 0, 0, $published_clean[1], $published_clean[2], $published_clean[0]));

echo '<a href="index.php?option=com_content&view=article&id='.$article_id.'">'.$title.'</a> - <i>'.$date2.'</i><br />'; 	
}

?>

Open in new window


3) Create a new Jumi item through the Jumi Component and point it to the custom page you just created.  (I generally save all of my Jumi articles in this location 'components/com_jumi/files/..)  This way I can just type in this in the "Path to file:" field:  components/com_jumi/files/test.php (or whatever you name the file).
4) Create a new menu item to point to that Jumi item you just created.
5) View the results.

Please let me know if you need any help with any of the steps.
0
 
Andrew DerseIT ManagerCommented:
This is what it looks like upon completion.
13.PNG
0
 
EverlearnerAuthor Commented:
Hi Thanks for your response.... when I create a new menu item, It asks me what type of item to create, if I select jumi it gives me 2 optiions blog or jumi, neither of which is outputting what I expect, what have I missed out?
0
 
EverlearnerAuthor Commented:
Awesome I just figured what I did wrong.....I modified it to onlyl included articles from certain categories and also descending dates.... what if I want the link to the article to be SEF, how do I do that?
0
 
Andrew DerseIT ManagerCommented:
Well, I honestly don't think I can work that magic...

I thought we could do a string split using PHP and replace the title spaces with hyphens, but it's not working properly.

All I can do for you buddy is get the non-sef links working...sorry.
0
 
EverlearnerAuthor Commented:
yeah it's weird I tried that , but the pages just come up blank... Thanks for your help with this
0
 
EverlearnerAuthor Commented:
do you think it will be possible if I use a plugin like sh404SEF?
0
 
Andrew DerseIT ManagerCommented:
That might work...
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

  • 6
  • 5
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now