I just started to use serendipity and defined some categories to post articles.
Everything is ok but now I need to modify the order the categories are displayed on my website.
How can I do that? In the category admin, I can only see how to define/remove categoriy.
Thank you in advance for your help.
Joel
Change order of categories?
-
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Re: Change order of categories?
Hi!
In the configuration of the categories plugin you can specifiy if categories should be sorted alphabeticaly, by their creation date or by their ID.
Sadly currently you cannot manually sort categories.
The other option is to build a manual category HTML nugget listing instead of an automatted one.
Best Regards,
Garvin
In the configuration of the categories plugin you can specifiy if categories should be sorted alphabeticaly, by their creation date or by their ID.
Sadly currently you cannot manually sort categories.
The other option is to build a manual category HTML nugget listing instead of an automatted one.
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/
# 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/
Re: Change order of categories?
manual catergory HTML nugget listing, what is this?garvinhicking wrote:Hi!
In the configuration of the categories plugin you can specifiy if categories should be sorted alphabeticaly, by their creation date or by their ID.
Sadly currently you cannot manually sort categories.
The other option is to build a manual category HTML nugget listing instead of an automatted one.
Best Regards,
Garvin
Because I am having the same problem I need to change the order the entries on my blogs frontpage are displayed and I cant figure it out.
Thanks
Mike
-
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Re: Change order of categories?
Hi!
1. Viewing the HTML output of your current category sidebar plugin
2. Copy that HTML code to an edito, shuffle it the way you need
3. Put the resulting HTML into a "HTML Nugget" sidebar plugin.
Beware that you need to change your HTML code everytime you add or remove a category, because with this method you effectively bypass the automatic functions.
Best regards,
Garvin
Basically, that just:manual catergory HTML nugget listing, what is this?
1. Viewing the HTML output of your current category sidebar plugin
2. Copy that HTML code to an edito, shuffle it the way you need
3. Put the resulting HTML into a "HTML Nugget" sidebar plugin.
Beware that you need to change your HTML code everytime you add or remove a category, because with this method you effectively bypass the automatic functions.
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/
# 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/
-
- Posts: 2
- Joined: Mon Feb 19, 2007 6:55 pm
If you're hip with databases, you could simply change the ID of your categories so it matches what you want. But, keep in mind, you'd need to start at a different number than "1".
For instance, if you've got 5 categories and you want them ordered "d e b a c", what I would do is change the category ID numbers:
a: 1 => 14
b: 2 => 13
c: 3 => 15
d: 4 => 11
e: 5 => 12
And then, if you really care about the ID#s going from 1-n, execute the sql statement: update s9y_category set categoryid=categoryid-10;
(where s9y_ is the table prefix in your database, and 10 is the number you wanna subtract off of all of 'em)
Granted, then you have to go into the database every time you want to rearrange something, but personally: I find it preferable to do that than to rearrange HTML because I think the chances of making a mistake (accidentally deleting some characters, that kind of thing) are much smaller with the database.
For instance, if you've got 5 categories and you want them ordered "d e b a c", what I would do is change the category ID numbers:
a: 1 => 14
b: 2 => 13
c: 3 => 15
d: 4 => 11
e: 5 => 12
And then, if you really care about the ID#s going from 1-n, execute the sql statement: update s9y_category set categoryid=categoryid-10;
(where s9y_ is the table prefix in your database, and 10 is the number you wanna subtract off of all of 'em)
Granted, then you have to go into the database every time you want to rearrange something, but personally: I find it preferable to do that than to rearrange HTML because I think the chances of making a mistake (accidentally deleting some characters, that kind of thing) are much smaller with the database.
Here is my idea to change the order of the categories without always having to edit code in the templates.
In the plugin_categories.tpl remove the code:
title="{$plugin_category.category_description|escape}"
from the line that creates the category title and link
Change the sorting method to description for the categories.
Edit the categories descrtion to something like
a,b,c,d,e...
Double letter may help with subcategories. The only things that appear to lost is the rollover function on the links
In the plugin_categories.tpl remove the code:
title="{$plugin_category.category_description|escape}"
from the line that creates the category title and link
Change the sorting method to description for the categories.
Edit the categories descrtion to something like
a,b,c,d,e...
Double letter may help with subcategories. The only things that appear to lost is the rollover function on the links