List articles of a specific category

Get help with installation and running phpwcms here. Please do not post bug reports or feature requests here.
Post Reply
Sparky
Posts: 3
Joined: Sun 23. May 2004, 17:50

List articles of a specific category

Post by Sparky »

Like the title says: Is there a way to list articles of a specific category, but not while editing the article. I know that there's an content type available for this purpose.

But I mean some kind of replacement tag for the template. My aim is to show article lists from 3 different categories on every page. So i must integrate it somehow into the template. Is there any workaround for this? Thanx guys!
User avatar
DeXXus
Posts: 2168
Joined: Fri 28. Nov 2003, 06:20
Location: USA - Florida

Re: List articles of a specific category

Post by DeXXus »

Sparky wrote:Like the title says: Is there a way to list articles of a specific category, but not while editing the article. I know that there's an content type available for this purpose...

But I mean some kind of replacement tag for the template.

Code: Select all

{RELATED:max_count_links} 
Place the x number of related articles based on keyword I guess? 
eg: {RELATED:5}
Sparky wrote:My aim is to show article lists from 3 different categories on every page.
Unfortunately, this tag would show 'X' number of articles of a single category (based on keyword) and disallow different categories to exist in the same section :(
Sparky
Posts: 3
Joined: Sun 23. May 2004, 17:50

Post by Sparky »

hmm

This would only show related articles to the actual one from all categories based on related keywords search.

I thought of something like {LIST_CAT_ARTICLES:CatID} where CatID is the category id from which the articles should be listed.
Sparky
Posts: 3
Joined: Sun 23. May 2004, 17:50

Post by Sparky »

Ok. Answering own qustions: In content.func.inc.php I've included:

Code: Select all

// Simple Navigation table of current cat
if( ! ( strpos($content["all"],'{NAV_TABLE_CAT:')===false ) ) {
	$content["all"] = preg_replace('/\{NAV_TABLE_CAT:(\d+)\}/e','nav_table_simple_struct($content["struct"], $1);', $content["all"]);
}
Now it lists subcategories of a given category, but still no articles...lol
But that's a start, isn't it? :wink:

If i put each article in different subcategory... :idea:
Nik2004
Posts: 132
Joined: Mon 9. Aug 2004, 14:31
Location: Athens,Greece

How to display articles of other categories?

Post by Nik2004 »

Hi,

If you have found a solution to this problem, please notify me. I want to display article lists of two categories (e.g. Announcements and News) in the homepage.

Anyone else who may have a workaround?

Nick
Post Reply