Is it possible to change the way a category reads when you look at it in the page? What I mean is this: I would like my category to be short when you see it in the nugget, but when you choose one of the pages in the category I would like to make it longer and slightly different.
Is this possible? If so..how?
Modify Categories?
-
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Re: Modify Categories?
Hi!
Yes, you can control this all via templating. You can check the variables documented in the s9y.org techincal documentation (Smarty/CSS Variables) and use $category_info for example to fit your index.tpl or entries.tpl.
Plus you can also use the plugin "Extended options for categories" to put a template on each category and then make independent index/entries.tpl templates for each category.
You can then also check on the $view parameter to see if you are reading a startpage, or a category, or an extended entry page. This variable is only available since serendipity 1.1, but previously you could use other variables like $is_single_entry etc.
HTH,
Garvin
Yes, you can control this all via templating. You can check the variables documented in the s9y.org techincal documentation (Smarty/CSS Variables) and use $category_info for example to fit your index.tpl or entries.tpl.
Plus you can also use the plugin "Extended options for categories" to put a template on each category and then make independent index/entries.tpl templates for each category.
You can then also check on the $view parameter to see if you are reading a startpage, or a category, or an extended entry page. This variable is only available since serendipity 1.1, but previously you could use other variables like $is_single_entry etc.
HTH,
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/
-
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Hi!
That's the one I mean.
You can then assign a different template to each category; within the templates .tpl files you can then add your Smarty IF/ELSE checks on the variables I mentioned.
This is not the easiest thing to do, so it might take you some time until you get the hang of it. It's a bit like mixing JavaScript and HTML, because you need those IF/ELSE logical constructs.
Best regards,
Garvin
That's the one I mean.
You can then assign a different template to each category; within the templates .tpl files you can then add your Smarty IF/ELSE checks on the variables I mentioned.
This is not the easiest thing to do, so it might take you some time until you get the hang of it. It's a bit like mixing JavaScript and HTML, because you need those IF/ELSE logical constructs.
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/
-
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Hi!
Yes, but you can assign a different template to each category, and thus use independent formattings/layouts using that plugin.
Best regards,
Garvin
Yes, but you can assign a different template to each category, and thus use independent formattings/layouts using that plugin.
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/
-
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Hi!
Yes, I would suggest you to duplicate the current template, and then only make the necessary modifications to the "sub-templates".
Best regards,
Garvin
Yes, I would suggest you to duplicate the current template, and then only make the necessary modifications to the "sub-templates".
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/
-
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Hi!
You don't need to hardcode the category name if you use the category-templates plugin to assign a different template for each category. Because then mt-XXX-1/ will be used for your first category, mt-XXX-2 will be used for another category and so forth. You need to assign a specific template to each category to make each category look different.
And you may need to check on the $is_single_entry variable to make a distinction between how to view multiple entries and how to view single entries.
I agree this is not very easy; it involves coding and logic formatting, and the use of Smarty. But that's how it is with customization.
Best regards,
Garvin
You don't need to hardcode the category name if you use the category-templates plugin to assign a different template for each category. Because then mt-XXX-1/ will be used for your first category, mt-XXX-2 will be used for another category and so forth. You need to assign a specific template to each category to make each category look different.
And you may need to check on the $is_single_entry variable to make a distinction between how to view multiple entries and how to view single entries.
I agree this is not very easy; it involves coding and logic formatting, and the use of Smarty. But that's how it is with customization.
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/