Page 1 of 1

Category / Article listing

Posted: Sun Dec 17, 2006 7:00 pm
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

Re: Category / Article listing

Posted: Sat Dec 23, 2006 10:58 am
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