SMF Support > SMF 2.0.x Support

Category Image

(1/1)

NIAB:
Hey,

Is there any way to make it so that Category name is an image?

Example: General Category would show category_image-,'$category['id']',.png

Marcus Forsberg:
Definitely possible, just go into BoardIndex.template.php and insert the image where you want it. $category['id'] is the correct variable. Something like:


--- Code: ---<img src="', $settings['images_url'], '/category_image-', $category['id'], '.png" alt="" />
--- End code ---

Place the images in ./Themes/{your_theme}/images. Of course, the above code doesn't check to see if the image exists at all so you'll have to make sure you upload an image for each category.

If you want to replace the title, you'll want to replace this line:


--- Code: ---', $category['link'], '
--- End code ---

To get the category URL in order to link the image to the category, use $category['href'].

Navigation

[0] Message Index

Go to full version