How To Use Category Specific Images For Your Category Strips
This article describes how to set up category specific images for each category on your site. This works for fixed width styles only.
Step One: Create Your Images First of all you need to create your images. You need one for each category on your site. The width of each one needs to be approx 100px less than your style width (eg if your style is 800px wide, then your image should be 700px wide). When saving your images, ensure that they have the filename cat_x.gif where x is the forumid number for the category that it will be used for. Ensure that the category title and any description text is included in the image. When you have created your images, upload them to a new directory in your images folder /images/categories/ For best results, your category background color should match that of the main background of your images, or blend with your background. Step Two: Locating The Template Section That We Will Be Working With To show the images that you have created, you need to edit one template: forumhome_forumbit_level1_nopost In the template, find Code:
<td class="tcat" colspan="<if condition="$vboptions[showmoderatorcolumn]">6<else />5</if>"> Step Three: Setting The Main Back Ground We need to change the background of the category strip to that of your image. So replace Code:
colspan="<if condition="$vboptions[showmoderatorcolumn]">6<else />5</if>"> Code:
style="background:url(images/categories/cat_$forumid.gif) no-repeat;" colspan="<if condition="$vboptions[showmoderatorcolumn]">5<else />4</if>" height="[high]height of images[/high]"> You will notice that the colspan numbers have changed. This is to allow the collapse button to display correctly. We will deal with that shortly. Step Four: Removing The Text And Ensuring The Link Still Works As you have added the category title and description to the image, you don't want to be showing that again, however, you still need the image to be clickable to enter that category. To do this, find Code:
<a href="forumdisplay.php?$session[sessionurl]f=$forum[forumid]">$forum[title]</a> Now find Code:
style="background:url($stylevar[imgdir_misc]/cat_$forumid.gif) no-repeat;" colspan="<if condition="$vboptions[showmoderatorcolumn]">5<else />4</if>" height="[high]height of images[/high]"> Code:
<a href="forumdisplay.php?$session[sessionurl]f=$forum[forumid]"><img src="clear.gif" width="100%" height="20" border="0"></a> Notice the code Code:
</td> Step Five: Aligning The Collapse Button Better As the collapse button now has it's own box, it needs to be aligned better to give a more professional look. To do this find Code:
<a style="float:$stylevar[right]" href="#top" Code:
<a href="#top" Step Six: Adding A Row For Subforum Information When you have clicked on your category, the next page displays information abour the subforums. As we have removed this information, this requires adding back in. To do this find Code:
</td> Code:
<if condition="$show['subforums']"> Step Seven: Save And Tweak All the edits are now complete, so save your template and have a look to see what it looks like. If you have any broken images, then you have either missed the images out when you created them, or you have not named them correctly. You may find at this point that the images do not show correctly in either IE or FF and are partially hidden under your forums. To adjust this, simply change the height setting entered in step three. Things To Remember If you add any further categories to your site, you will also need to create additional images for them otherwise they will display broken images and break your style. Try and keep to a plain background for your images so that you can use the same color for your tcat background in the style manager. This is so that the box with the collapse button blends with the image. I hope that you find this useful. Feel free to ask any questions about this article. If you have used this, and wish to show off your work, please let me have the URL to your forums and I will add your site to the article as a demo. Demo Links http://www.hiphopscrypt.com/forums/?styleid=24 |
Very Useful! Thanks for your post, I will be using this on many custom skins in the future!
-Vibe- |
Ditto, nice work
|
thank for post, great job peterska2
|
Very nice work. That will come in handy for sure.
|
Sounds like a great hack. Anyone else have a demo of how theirs looks?
Thanks |
I like! this is something I'll definitely practice on.
|
Great post man! Thanks!
|
why have to go through all that for just that?
there're easier way... |
Such as?
|
Kerry-Anne,
I found these today - work very well in the postbit. Nothing new I know but when put together effective: PHP Code:
|
there is any screen shots becouse above link is not working now anymore
|
Quote:
|
The demo link does not work. Do we have screencaps or another demo link?
--------------- Added [DATE]1218078055[/DATE] at [TIME]1218078055[/TIME] --------------- Quote:
Code:
</table> |
Is there any answer to this?
|
Hello? Anybody Here?
|
All times are GMT. The time now is 07:27 PM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|