Category / Article listing

Creating and modifying plugins.
Post Reply
zerocanon
Posts: 1
Joined: Fri Dec 08, 2006 3:59 pm

Category / Article listing

Post by zerocanon »

This isn't really a "plugin" problem as it will probably require modification of the main code of the site (which I know can cause problems when upgrading), but I'm looking to change the entry listings so that when a category is selected; the entries for that category are displayed and the titles of the subcategories are displayed at the end. Right now, when I select a category, the entries in the category plus entries in the subcategories are displayed.

Category 1
Entry 1
Entry 2
......Subcategory 1
......Subcategory Entry 1
......Subcategory Entry 2
......Subcategory 2



Would display (if category 1 was selected):

Entry 1 Title
----------------
Entry 2 Title
----------------
Subcategory 1
----------------
Subcategory 2
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Category / Article listing

Post by garvinhicking »

Hi!

Hm, the thing you will need to modify is not a plugin, but your template. You will need to edit your entries.tpl file and add some IF-Checks there to see if you're in a category and if so, fetch all categories and walk the array.

To fetch categories you'll need to use the s9y API function serendipity_fetchCategories. You can create a custom Smarty function in your templates 'config.inc.php' with which you can cycle the categories in smarty already.

This will be some serious modification, so get prepared to wade through documentation of s9y and Smarty for this. :) It should not be really hard, but just time intensive. If you have any specific questions or so, we will be here to gladly help you!

If you can't get it done until after christmas I can have a more thorough look at this for you. ;)


Best regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Post Reply