Templates

Can I list the latest X number of items from a category in my sidebar?

Scenario:
"I want to list X of the latest items of one category to my sidebar. How can I do this?"

Solution:
Create a new template called "headlines" which contains the following code in the Item Header section:

<li><a href="<%itemlink%>" title="<%title%>"><%title%></a></li>

Then place this code where you want your list to appear:

<ul>
<%otherblog(blogname,headlines,X,categoryname)%>
</ul>

where blogname is the name of your blog, templatename is the name of your headline template to show just the linked item titles and categoryname is the name of your category.

Original forum thread (thanks, Leng!):
http://forum.nucleuscms.org/viewtopic.php?t=14468

section: Templates | submitted by Leng on 2007.Aug.18 | 1004 views

item rate
Total votes: 1 - Rating: 5.00

Please tell us how useful this answer was to you (0 = useless, 10 = very very helpful):

10