Category Icons / Images
Category Icons / Images
When settings up my blog I assigned certain pictures to each category.
I've just noticed that those pictures never seem to be used.
Where / when should they be displayed?
How do I fix this?
Thank you,
Nim
I've just noticed that those pictures never seem to be used.
Where / when should they be displayed?
How do I fix this?
Thank you,
Nim
-
garvinhicking
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Re: Category Icons / Images
Hi!
Usually if you post an entry to a category, viewing that category on the frontpage should contain an category icon.
This depends on the template you are using, some do not use it. The Serendipity 3.0 default theme displays it in the info box, for example.
Best regards,
Garvin
Usually if you post an entry to a category, viewing that category on the frontpage should contain an category icon.
This depends on the template you are using, some do not use it. The Serendipity 3.0 default theme displays it in the info box, for example.
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/
-
garvinhicking
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Hi!
Sadly I don't know the competition that well - but you might want to take the default/entries.tpl file and compare it to the one of the competition theme. Look for the string 'category_icon'!
HTH,
Garvin
Sadly I don't know the competition that well - but you might want to take the default/entries.tpl file and compare it to the one of the competition theme. Look for the string 'category_icon'!
You can configure your categories plugin to enable smarty templating. Then you can copy the 'plugin_categories.tpl' smarty file to your theme directory and customize it with category icons!Do you know if there is a file where I can edit the category menu, instructing it to use my icons instead of that red square?
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/
Hi
Category icons are disabled in my competition template. If you'd like to enable them look for the following code in the entries.tpl
and remove the '<!--' from the start and the '-->' from the end.
To get the category list plugin to use your category icon I think you just turn on the smarty option in the categories plugin config. If you want to style the plugin you'll need to copy plugin_categories.tpl from the default template folder into the competition folder.
HTH
Dave
Category icons are disabled in my competition template. If you'd like to enable them look for the following code in the entries.tpl
Code: Select all
<!--
<span class="serendipity_entryIcon">
{foreach from=$entry.categories item="entry_category"}
{if $entry_category.category_icon}
<a href="{$entry_category.category_link}"><img class="serendipity_entryIcon" title="{$entry_category.category_name|@escape}{$entry_category.category_description|@emptyPrefix}" alt="{$entry_category.category_name|@escape}" src="{$entry_category.category_icon}" /></a>
{/if}
{/foreach}
</span>
-->To get the category list plugin to use your category icon I think you just turn on the smarty option in the categories plugin config. If you want to style the plugin you'll need to copy plugin_categories.tpl from the default template folder into the competition folder.
HTH
Dave
Ok, I request babysteps for the NimNim (ie me).
I'm looking here: G:\My Webs\1&1\Blog\Serendipity\serendipity\plugins ... is that the wrong folder in which to find the categories plugin config?
I'm going to try that to see what it does, before I try anything with plugin_categories.tpl.
Sorry to be a bother.
Nim
I'm looking here: G:\My Webs\1&1\Blog\Serendipity\serendipity\plugins ... is that the wrong folder in which to find the categories plugin config?
I'm going to try that to see what it does, before I try anything with plugin_categories.tpl.
Sorry to be a bother.
Nim
Ok, I've done that.
Edit away heheheh ... I don't know PHP, so reading it that file I'm guessing it what it all means.
Would I be right that this is the bit that calls the image to the category menu:
{if !empty($category_image)}
<a class="serendipity_xml_icon" href="{$plugin_category.feedCategoryURL}"><img src="{$category_image}" alt="XML" style="border: 0px" /></a>
{/if}
If so, then I need to know how to edit that part. I need to specify each category name, and call the appropriate image. How do I do that???
Nim
Edit away heheheh ... I don't know PHP, so reading it that file I'm guessing it what it all means.
Would I be right that this is the bit that calls the image to the category menu:
{if !empty($category_image)}
<a class="serendipity_xml_icon" href="{$plugin_category.feedCategoryURL}"><img src="{$category_image}" alt="XML" style="border: 0px" /></a>
{/if}
If so, then I need to know how to edit that part. I need to specify each category name, and call the appropriate image. How do I do that???
Nim
-
garvinhicking
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Hi!
You can enter this code:
Regards,
Garvin
You can enter this code:
Code: Select all
{if $plugin_category.category_name == 'Media'}
<img src="/path/to/your/image.gif" alt="Cateogry icon" style="border: 0px" />
{else if $plugin_category.category_name == 'Private'}
<img src="/path/to/your/image2.gif" alt="Cateogry icon" style="border: 0px" />
{else if $plugin_category.category_name == 'Public'}
<img src="/path/to/your/image3.gif" alt="Cateogry icon" style="border: 0px" />
{/if}
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/
Hi again,
I've edited the code you gave me, to this:
{if $plugin_category.category_name == 'Books'}
<img src="/Serendipity/templates/competition/img/Books.gif" alt="Books" style="border: 0px" />
{else if $plugin_category.category_name == 'CFS'}
<img src="/Serendipity/templates/competition/img/CFS.gif" alt="CFS" style="border: 0px" />
{else if $plugin_category.category_name == 'Depression'}
<img src="/Serendipity/templates/competition/img/Depression.gif" alt="Depression" style="border: 0px" />
{else if $plugin_category.category_name == 'Dreams'}
<img src="/Serendipity/templates/competition/img/Dreams.gif" alt="Dreams" style="border: 0px" />
{else if $plugin_category.category_name == 'General'}
<img src="/Serendipity/templates/competition/img/General.gif" alt="General" style="border: 0px" />
{else if $plugin_category.category_name == 'Pets'}
<img src="/Serendipity/templates/competition/img/Pets.gif" alt="Pets" style="border: 0px" />
{else if $plugin_category.category_name == 'Work'}
<img src="/Serendipity/templates/competition/img/Work.gif" alt="Work" style="border: 0px" />
{/if}
I wasn't quite sure where to put it, so I tried it in various different places, within plugin_categories.tpl .. but each time it gives me this error:
Fatal error: Smarty error: [in file:/kunden/homepages/21/d98723615/htdocs/Serendipity/templates/competition/plugin_categories.tpl line 21]: syntax error: unexpected {else} (Smarty_Compiler.class.php, line 468) in /homepages/21/d98723615/htdocs/Serendipity/bundled-libs/Smarty/libs/Smarty.class.php on line 1088
Any idea what I might be doing wrong?
Nim
I've edited the code you gave me, to this:
{if $plugin_category.category_name == 'Books'}
<img src="/Serendipity/templates/competition/img/Books.gif" alt="Books" style="border: 0px" />
{else if $plugin_category.category_name == 'CFS'}
<img src="/Serendipity/templates/competition/img/CFS.gif" alt="CFS" style="border: 0px" />
{else if $plugin_category.category_name == 'Depression'}
<img src="/Serendipity/templates/competition/img/Depression.gif" alt="Depression" style="border: 0px" />
{else if $plugin_category.category_name == 'Dreams'}
<img src="/Serendipity/templates/competition/img/Dreams.gif" alt="Dreams" style="border: 0px" />
{else if $plugin_category.category_name == 'General'}
<img src="/Serendipity/templates/competition/img/General.gif" alt="General" style="border: 0px" />
{else if $plugin_category.category_name == 'Pets'}
<img src="/Serendipity/templates/competition/img/Pets.gif" alt="Pets" style="border: 0px" />
{else if $plugin_category.category_name == 'Work'}
<img src="/Serendipity/templates/competition/img/Work.gif" alt="Work" style="border: 0px" />
{/if}
I wasn't quite sure where to put it, so I tried it in various different places, within plugin_categories.tpl .. but each time it gives me this error:
Fatal error: Smarty error: [in file:/kunden/homepages/21/d98723615/htdocs/Serendipity/templates/competition/plugin_categories.tpl line 21]: syntax error: unexpected {else} (Smarty_Compiler.class.php, line 468) in /homepages/21/d98723615/htdocs/Serendipity/bundled-libs/Smarty/libs/Smarty.class.php on line 1088
Any idea what I might be doing wrong?
Nim
-
garvinhicking
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Hi!
Upps. You need to use "elseif" instead of "else if".
Regards,
Garvin
Upps. You need to use "elseif" instead of "else if".
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/
Ah. Thanks ... NOW my husband says 'Oh yeah .. that makes sense!!!!'
Can you have a quick look please: http://www.sylviathornhill.co.uk/Serendipity/index.php
The pictures are coming up as red squares, which obviously means I have the path wrong (they're in my template images folder); I'm pretty sure I can figure that part out.
The other image is still there though .. xml.gif image. Any idea how to get rid of it altogether?
Thanks
Nim
Can you have a quick look please: http://www.sylviathornhill.co.uk/Serendipity/index.php
The pictures are coming up as red squares, which obviously means I have the path wrong (they're in my template images folder); I'm pretty sure I can figure that part out.
The other image is still there though .. xml.gif image. Any idea how to get rid of it altogether?
Thanks
Nim
