Author Topic: Picture next to the category, even there is no picture in the category  (Read 7023 times)

0 Members and 1 Guest are viewing this topic.

Offline TIMT

  • Hero Member
  • *****
  • Posts: 505
    • View Profile
Hi

I show a random picture next to the category. Now I have a Subcategory with no picture and then a sub-sub-category with pictures

photo clubs (no pictures in it)
   photo club A (no pictures in it)
      Animals (with pictures in it - the picture next to the category is shown)
      Fantasy (with pictures  - the picture next to the category is shown)
      Architecture (with pictures  - the picture next to the category is shown)
      ...
      ...

Now I'd like to show a picture next to the category for each category, even there is no picture in it.
The picture could be a picture of the subcategory or a picture defined with the mod from V@no ([MOD] Category Image v1.0.1)
http://www.4homepages.de/forum/index.php?topic=6922.0

Is there any possibility?

Thanks!

Offline Acidgod

  • 4images Moderator
  • 4images Guru
  • *****
  • Posts: 2.421
  • It's me?
    • View Profile
    • Flash-Webdesign
Re: Picture next to the category, even there is no picture in the category
« Reply #1 on: October 13, 2005, 07:53:21 AM »
The picture could be a picture of the subcategory or a picture defined with the mod from V@no ([MOD] Category Image v1.0.1)
http://www.4homepages.de/forum/index.php?topic=6922.0

Is there any possibility?

Yes?!?
Thats the way the Mod works... You can take any Image ID as Picture for your Category...

Offline TIMT

  • Hero Member
  • *****
  • Posts: 505
    • View Profile
Re: Picture next to the category, even there is no picture in the category
« Reply #2 on: October 13, 2005, 12:32:52 PM »
but I can not show random pics for categories with pictures and a defined picture for a category with no picture in it, right?
How can I use both possibilities?

I have now two definitions in category_bit html

random-image:
Code: [Select]
{if random_cat_image_file}<a href="{cat_url}"><img src="{random_cat_image_file}" class="schwarz" border="0"  width="40" height="40"></a>{endif random_cat_image_file} 
and

image regarding definition on the category (v@no-Mod)
Code: [Select]
{if cat_image}<img src="{cat_image}">{endif cat_image}

Offline TIMT

  • Hero Member
  • *****
  • Posts: 505
    • View Profile
Re: Picture next to the category, even there is no picture in the category
« Reply #3 on: October 23, 2005, 11:03:15 AM »
for some categories, I have a fix image defined (MOD from V@no)  http://www.4homepages.de/forum/index.php?topic=6922.0
it should be checked, if a fix image is defined. when Yes, show this picture, when No, show a random picture.

in category_bit.html I have this two lines. But how can I implement the check?

random-image:
Code: [Select]
{if random_cat_image_file}<a href="{cat_url}"><img src="{random_cat_image_file}" class="schwarz" border="0"  width="40" height="40"></a>{endif random_cat_image_file}
image regarding definition on the category (v@no-Mod)
Code: [Select]
{if cat_image}<img src="{cat_image}">{endif cat_image}
Thanks for helping me!

Offline TIMT

  • Hero Member
  • *****
  • Posts: 505
    • View Profile
Re: Picture next to the category, even there is no picture in the category
« Reply #4 on: October 23, 2005, 02:35:49 PM »
OK, I got it... and it's simple...

just put the code
Code: [Select]
{if cat_image}<img src="{cat_image}">{endif cat_image}above
Code: [Select]
{if random_cat_image_file}<a href="{cat_url}"><img src="{random_cat_image_file}" class="schwarz" border="0"  width="40" height="40"></a>{endif random_cat_image_file}
If there is no picutre defined in the category, I see the random-image. If a picture is defined, this defined picture is shown.

Offline freimanner

  • Pre-Newbie
  • Posts: 3
    • View Profile
Re: Picture next to the category, even there is no picture in the category
« Reply #5 on: December 10, 2008, 07:59:01 PM »
hi everyone....well this thread is pretty old, but i hope that somebody can help  :wink:

just wanted to do the same as TIMT:

show a defined picture with described mod. Otherwise, if no picture is set, display a random one from the category.

- random picture works
- mod with defined picture works

but there is no "else" or "if no cat image" in category_bit.html. So instead of only seeing the defined picture, I see the random one too - hope this is clear to understand.

thanks in advance

added code from category_bit.

Code: [Select]
<td valign="top">
{if cat_image}<img src="{cat_image}" width="60px" height="45px">{endif cat_image} 
{if random_cat_image_file}<img src="{random_cat_image_file}" width="60px" height="45px">{endif random_cat_image_file}
 </td>


« Last Edit: December 10, 2008, 08:22:23 PM by freimanner »

Offline KurtW

  • 4images Guru
  • *******
  • Posts: 2.778
    • View Profile
    • Malediven-Bilder ~~Dreams~~
Re: Picture next to the category, even there is no picture in the category
« Reply #6 on: December 11, 2008, 06:03:19 AM »
Hi freimanner ,

in 1.7.6 normally run also this for every {if tags}:

Code: [Select]
{if cat_image}
  <img src="{cat_image}">
{endif cat_image}
{ifnot cat_image}
 {if random_cat_image_file}
   <img src="{random_cat_image_file}" width="60px" height="45px">
 {endif random_cat_image_file}
{endifnot cat_image}


Kurt

Offline freimanner

  • Pre-Newbie
  • Posts: 3
    • View Profile
Re: Picture next to the category, even there is no picture in the category
« Reply #7 on: December 11, 2008, 06:01:55 PM »
hmm, so simple  :oops:
thanks - works perfectly