List Items
Background
Initially this plugin was designed to help solve the problem of displaying "workouts" on a client's exercise site. The client wished to be able to show listings of various "exercises" within the content of one main "workout" article. These exercise articles were in various sections and categories so there did not seem a straight forward way to get this done.
Technicalities
The plugin looks for this tag in the text of an article (minus the spaces):
{ listitems [options] }comma separated list of article ids{ /listitems }It then creates a frontpage-style blog layout in the middle of your content with parameters as globally defined in the plugin parameters, or as over ruled in the [options] part of the plugin tag. The [options] take the form of a query string which can override any of the following parameters:
- pageclass_sfx
- num_leading_articles
- num_intro_articles
- num_columns
- num_links
- orderby_pri
- orderby_sec
- multi_column_order
- show_pagination
- show_pagination_results
- show_feed_link
- show_noauth
- show_title
- link_titles
- show_intro
- show_section
- link_section
- show_category
- link_category
- show_author
- show_create_date
- show_modify_date
- show_item_navigation
- show_readmore
- show_vote
- show_icons
- show_pdf_icon
- show_print_icon
- show_email_icon
- show_hits
- feed_summary
- filter_groups
- filter_type
Since ListItems uses the core Joomla content component to display the articles the parameters have mostly not been altered from the Joomla options so they can be passed across easily. However you should notice that because of this, in the list of parameters above, page refers to the listing which is produced, NOT to the entire page.
Another advantage of using the joomla content component to display the articles is that you do not need to do any styling to make the listings fit straight into your template styles (including template overrides!). If you do want to do some different formatting however you also have the option to set the pageclass_sfx.
Changelog
Version 1.01 (29-10-2009)
Fixed the warning notices: "Unknown column 'f.ordering'" and "Warning: array_slice() expects parameter 1 to be array...". These should not appear on live sites but were caused by a badly formed database query, throwing a warning on localhost and not showing any articles in a live environment (where error reporting is usually set to a lower level).
Demo & Downloads
![]() |
Download |
GNU/GPL
This e-mail address is being protected from spambots. You need JavaScript enabled to view it
Homepage 2009-06-04 English Joomla 1.5 7.33 KB | 1185 |
You can see another example on our main Joomla Extensions page under "Showcase".
Example 1
{ listitems num_leading_articles=2&num_intro_articles=0 }47,48,49,50,1,2,5,3,7,8{ /listitems } This example shows how we can create a list of just two leading articles - ie articles which appear full-width of the content area.
Make flash video links absolute
When making a site for a client which involved a lot of embedded flash videos, we noticed that we kept losing the video in Internet Explorer (v6 + 7). This turned out to be caused by a combination of the SEF (Search-Engine-Friendly) url rewriting and the use of relative links to the videos in the articles. We could fix it by changing all of the links to absolute ones, but this meant going into hundreds of articles and changing each video link. Also it would have meant that were the client to move server at some point in the future, the whole process would have to be done again. Not good!
Spec Image
We wanted to be able to show different images appearing across the footer of a site which would change depending on which area of the site the user was in. A small development on the core Joomla random image module. The menu items are linked in the database to an image, or a folder from which to pick a random image, and footer was expanded to any module position.
Example 2
{ listitems num_leading_articles=0&num_intro_articles=4&num_links=0 }47,48,49,50,1,2,5,3,7,8{ /listitems } Here we are using the listitems plugin to show the articles in only the intro-style. We have set the links and the leading articles so that they do not appear.
Make flash video links absoluteWhen making a site for a client which involved a lot of embedded flash videos, we noticed that we kept losing the video in Internet Explorer (v6 + 7). This turned out to be caused by a combination of the SEF (Search-Engine-Friendly) url rewriting and the use of relative links to the videos in the articles. We could fix it by changing all of the links to absolute ones, but this meant going into hundreds of articles and changing each video link. Also it would have meant that were the client to move server at some point in the future, the whole process would have to be done again. Not good! Difficulty RatingWhile we were working on an Exercise & Fitness website the client had a request for some of the articles - containing details of specific exercises and workouts - to have difficulty ratings showing on each article and also, more discretely, on the category blog-listings. |
Spec ImageWe wanted to be able to show different images appearing across the footer of a site which would change depending on which area of the site the user was in. A small development on the core Joomla random image module. The menu items are linked in the database to an image, or a folder from which to pick a random image, and footer was expanded to any module position. Health & Fitness StatsTo allow users of an Exercise & Fitness community site to be able to record their progress of various health and fitness measures such as body weight, blood pressure, number of press-ups in 60seconds, time for 1000m run etc. Goals can be set by the user which appear as red lines across the graph area. The user is also given the option to create 'custom stats' for which they can set the unit of measurement and whether best is highest or lowest. |
Example 3
{ listitems num_leading_articles=0&num_intro_articles=0&num_links=5&show_pagination=0 }47,48,49,50,1,2,5,3,7,8{ /listitems }Finally we show a simple list of links without any intro or leading articles, and no pagination of the results.

This e-mail address is being protected from spambots. You need JavaScript enabled to view it
Comments
The tag just gets displayed in the frontend!
Tom
It does what I needed - displays different articles in blog layout. The only limitation, that I can apply this plugin in article only.
I need to display blog layout articles from specified range within blog category menu page. My idea is to put this article blocks in named tabs in order to switch among them easily. When clicking to the article I go to the next hierarchy level and in any time can be back to the parent category page with all articles listed.
In your case I cannot do like this.
To overcome this limitation I tried to organize tabbed blocks of articles in one article with this plugin and show its content at the blog category page using various modules developed so far for displaying article content anywhere but with no success.
Anyway you made great plugin, Tom0. The main drawback to my mind is that the navigation hierarchy is not kept using it.
Sincerely yours,
Oleg
Glad you like the plugin! I have to say I am a little confused by what you are wanting, or what you see as the limitations... Have you got any links I could look at to understand your problem a bit better? What do you mean by navigation hierarchy?
Tom
Sorry not replying for a long time.
You can see what I wanted here:
www (zelen-hram) ru/online-library/pravoslavnie-pr azdniki.html
This is category page with blog layout. When you click any article in any block you go to the next (lower) hierarchy level. And you can be back at any time. Your plugin doesn't work at this page because it is category description page. So I'd appreciate if your plugin works not only whithin article but at category and section desctription pages also.
I get this error dump instead of articles listed:
>>>
No valid database connection Unknown column 'f.ordering' in 'order clause' SQL=SELECT a.id, a.title, a.alias, a.title_alias, a.introtext, a.fulltext, a.sectionid, a.state, a.catid, a.created, a.created_by, a.created_by_alias, a.modified, a.modified_by, a.checked_out, a.checked_out_time, a.publish_up, a.publish_down, a.images, a.attribs, a.urls, a.metakey, a.metadesc, a.access, CASE WHEN CHAR_LENGTH(a.alias) THEN CONCAT_WS(':', a.id, a.alias) ELSE a.id END as slug, CASE WHEN CHAR_LENGTH(cc.alias) THEN CONCAT_WS(":", cc.id, cc.alias) ELSE cc.id END as catslug, CHAR_LENGTH( a.`fulltext` ) AS readmore, u.name AS author, u.usertype, g.name AS groups, u.email as author_email, cc.title AS category, s.title AS section, s.ordering AS s_ordering, cc.ordering AS cc_ordering, a.ordering AS a_ordering FROM jos_content AS a LEFT JOIN jos_categories AS cc ON cc.id = a.catid LEFT JOIN jos_sections AS s ON s.id = a.sectionid LEFT JOIN jos_users AS u ON u.id = a.created_by LEFT JOIN jos_groups AS g ON a.access = g.id WHERE a.id IN ( 53,2,56 ) ORDER BY f.ordering
Warning: array_slice() expects parameter 1 to be array, null given in C:\xampp\htdocs\macrosoftware\plugins\content\listitems\frontpage.php on line 122
Warning: Invalid argument supplied for foreach() in C:\xampp\htdocs\macrosoftware\plugins\content\listitems\frontpage.php on line 130
No valid database connection Unknown column 'f.ordering' in 'order clause' SQL=SELECT a.id, a.title, a.alias, a.title_alias, a.introtext, a.fulltext, a.sectionid, a.state, a.catid, a.created, a.created_by, a.created_by_alias, a.modified, a.modified_by, a.checked_out, a.checked_out_time, a.publish_up, a.publish_down, a.images, a.attribs, a.urls, a.metakey, a.metadesc, a.access, CASE WHEN CHAR_LENGTH(a.alias) THEN CONCAT_WS(':', a.id, a.alias) ELSE a.id END as slug, CASE WHEN CHAR_LENGTH(cc.alias) THEN CONCAT_WS(":", cc.id, cc.alias) ELSE cc.id END as catslug, CHAR_LENGTH( a.`fulltext` ) AS readmore, u.name AS author, u.usertype, g.name AS groups, u.email as author_email, cc.title AS category, s.title AS section, s.ordering AS s_ordering, cc.ordering AS cc_ordering, a.ordering AS a_ordering FROM jos_content AS a LEFT JOIN jos_categories AS cc ON cc.id = a.catid LEFT JOIN jos_sections AS s ON s.id = a.sectionid LEFT JOIN jos_users AS u ON u.id = a.created_by LEFT JOIN jos_groups AS g ON a.access = g.id WHERE a.id IN ( 53,2,56 ) ORDER BY f.ordering
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in C:\xampp\htdocs\macrosoftware\libraries\joomla\database\database\mysql.php on line 344
It looks like you have some database issues. "No valid database connection" is never a good sign. Also the sql error - unknown column 'f.ordering' caused by the "ORDER BY f.ordering" part of the query - should not occur since this should not be in the query at all. The other errors are caused by this failure. I suggest un + reinstalling. If you still have problems I can take a look when you have it on a server but dont know what else to suggest at the moment.
Tom
the strange thing is that everything else works OK. Just this "List items" cause troubles. Could this be caused by PHP or MySQL versions? What are the versions required?
Thanks,
Petr
Following the comments below I have reviewed this issue further in depth and think I have fixed your problem. Try version 1.01 of the plugin now available.
Cheers,
Tom
Warning: array_slice() expects parameter 1 to be array, null given in /home/ucctryon/public_html/plugins/content/listitems/frontpage.php on line 122
Warning: Invalid argument supplied for foreach() in /home/ucctryon/public_html/plugins/content/listitems/frontpage.php on line 130
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/ucctryon/public_html/libraries/joomla/database/database/mysql.php on line 344
Please Help... Thanks,
Emily
Try version 1.01 of the plugin now available - I think this should fix these warnings.
Cheers,
Tom
Do you mean the tag doesnt appear or the containing article doesnt appear? Try messing about with the plugin parameters in the backend and see if anything comes up. Also try installing the latest version - this may fix it.
Tom
List Items
Initially this plugin was designed to help solve the problem of displaying "workouts" on a client's exercise site. The client wished to be able to show listings of various "exercises" within the content of one main "workout" article. These exercise articles were in various sections and categories so there did not seem a straight forward way to get this done.
Read more...
You have to use the tag without spaces - it is only listed with spaces on this page just so it doesnt get processed! Have you made sure that the plugin is enabled in the backend? Try messing about with the plugin parameters in the backend and see if anything comes up. Also try installing the latest version - this may fix it.
Tom
I am wondering if your extension will work for what I need done on my Joomla site.
On the Joomla frontpage at the bottom, there is the Joomla core "More Articles" list of links.
Anytime you click to read an article in full - I would like to display that same kind of "More Articles" list of links at the bottom of each full article page.
Can you extension do that?
Thanks!
This looks like a really nifty little plugin. What I wanted to do was list specific articles in one section within. I have been trying to do this with modules before which didn't work, and this seems like the right solution. The only trouble is, I would like the plugin to automatically pick up all of the latest articles in just one section/category, and therefore not defined in the list.
Also, is there a way of replacing the More Articles text with something a little snappier?