4images Modifications / Modifikationen > Templates & Styles (Requests & Discussions)
Show a thumbnail instead of a folder icon next to category
jarano:
Hi Chris!
You are right, I am sorry.
Regards
wiitanen:
--- Quote from: Chris on March 12, 2005, 10:39:37 PM ---By default, the category_bit.html template displays a folder icon next to categories. It is possible to also display a thumbnail of an image selected at random from that category.
In the category_bit.html template that ships with the downloaded distribution of 4images, there is the following:
--- Code: ---<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td valign="top">
<img src="{template_url}/images/folder.gif" width="20" height="13" alt="" />
<!-- {if random_cat_image_file}<a href="{cat_url}"><img src="{random_cat_image_file}" border="1"></a>{endif random_cat_image_file} -->
</td>
<td> <a href="{cat_url}" class="maincat">{cat_name}</a> ({num_images})
{if cat_is_new}<sup class="new">{lang_new}</sup>{endif cat_is_new} </td>
</tr>
</table>
--- End code ---
As you can see above, there is already HTML that can display a random category image thumbnail. It is simply commented out. To activate the thumbnail, uncomment the HTML. In this example the folder icon HTML is deleted in favor of the image thumbnail.
--- Code: ---<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td valign="top">
{if random_cat_image_file}<a href="{cat_url}"><img src="{random_cat_image_file}" border="1"></a>{endif random_cat_image_file}
</td>
<td> <a href="{cat_url}" class="maincat">{cat_name}</a> ({num_images})
{if cat_is_new}<sup class="new">{lang_new}</sup>{endif cat_is_new} </td>
</tr>
</table>
--- End code ---
Lastly, this feature is enabled by default, but if you previously edited includes/constants.php, check to ensure that the following line is present in that file:
--- Code: ---define('SHOW_RANDOM_CAT_IMAGE', 1);
--- End code ---
--- End quote ---
OK - so... removing the 'Comment Out' gives me code that still shows the folder icon AND the random image. I changed the code to the following:
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td valign="top">
<img src="{template_url}/images/folder.gif" width="20" height="13" alt="" border="0" />
{if random_cat_image_file}<a href="{cat_url}"><img src="{random_cat_image_file}" width="20" height="13" border="0"></a>{endif random_cat_image_file}
</td>
<td>
<a href="{cat_url}" class="maincat">{cat_name}</a> ({num_images})
{if cat_is_new}<sup class="new">{lang_new}</sup>{endif cat_is_new}
</td>
</tr>
</table>
{if cat_description}<span class="smalltext">{cat_description}</span><br />{endif cat_description}
{if sub_cats}{sub_cats}{endif sub_cats}
It would be nice if the random image icon would show up without the folder, and only show the folder if no random image was found. I just can't see where this is done.
TheOracle:
--- Quote ---
It would be nice if the random image icon would show up without the folder, and only show the folder if no random image was found. I just can't see where this is done.
--- End quote ---
With the EXIF MOD, it would be easier to convert
this line :
--- Quote ---
<img src="{template_url}/images/folder.gif" width="20" height="13" alt="" />
--- End quote ---
into :
--- Code: ---
{ifno random_cat_image_file}<img src="{template_url}/images/folder.gif" width="20" height="13" alt="" />{endifno random_cat_image_file}
--- End code ---
From there, it would even be much easier, for you, to customize this line rather than modifying a whole paragraph in order to replace a folder icon into a thumbnail presentation. ;)
V@no:
--- Quote from: TheOracle on August 09, 2005, 10:11:37 PM ---
--- Code: ---
{ifno random_cat_image_file}<img src="{template_url}/images/folder.gif" width="20" height="13" alt="" />{endifno random_cat_image_file}
--- End code ---
From there, it would even be much easier, for you, to customize this line rather than modifying a whole paragraph in order to replace a folder icon into a thumbnail presentation. ;)
--- End quote ---
please note, for this to work u'll need install "{ifno blah}...{endifno blah}" mod/fix (try FAQ) ;)
TheOracle:
Correction of the name - added with the URL this time :
http://www.4homepages.de/forum/index.php?topic=7493.0
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version