Author Topic: Icon before each subcategory - how to?  (Read 3168 times)

0 Members and 1 Guest are viewing this topic.

Offline Gwydion

  • Full Member
  • ***
  • Posts: 126
    • View Profile
Icon before each subcategory - how to?
« on: April 15, 2006, 12:38:33 PM »
I have tried to find a better looking way to group subcategories but am back to the default where they are listed in one line and the width is determined by the td width.
However it might look better if a small icon (circle, dot, whatever) is placed in front of each subcategory.
I assume this must be done in functions.php but I don't know what the correct code would be.
Can somebody pls. help? I do not want images (random or not) from the database, just a small static icon e.g.
o sub 1  o sub 2  o sub 3
o subwithverylongname 4  o sub 5

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: Icon before each subcategory - how to?
« Reply #1 on: April 16, 2006, 06:05:01 AM »
in includes/functions.php find
Code: [Select]
      $sub_cat_list .= "<a href=\"".$sub_url."\" class=\"subcat\">".$cat_cache[$subcat_id]['cat_name']."</a>";
replace with
Code: [Select]
      $sub_cat_list .= "<a href=\"".$sub_url."\" class=\"subcat\"><img src=\"".get_gallery_image("subcaticon.gif")."\" border=\"0\">".$cat_cache[$subcat_id]['cat_name']."</a>";

upload subcaticon.gif into templates/<your template>/images/ directory
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)