Webmastersite.net
Register Log In

Associating a unique image with each cat

Comments on Associating a unique image with each cat

capitaine
Forum Regular

Usergroup: Customer
Joined: Aug 05, 2005

Total Topics: 94
Total Comments: 272
2 of 4 people found this comment helpful
Posted Aug 14, 2005 - 9:46 AM:

Is there a way I can associate a specific image with a specific category, when I'm viewing that category's page? That is, I don't want to replace the folder graphic on the main index page that is next to each category - just would like to place an image next to the category name on the category page

Each category has an id... so I guess I could name the images something like 1.gif and then call them in displaylinks.tpl by using something like <img src="{CATID).gif" />. Would that be the right way to do it?
trued
Experienced

Usergroup: Customer
Joined: Oct 10, 2003

Total Topics: 19
Total Comments: 69
trued
2 of 4 people found this comment helpful
Posted Aug 14, 2005 - 9:54 AM:

this thread might help..

www.webmastersite.net/forum...hp?id=5339&highlight=trued
capitaine
Forum Regular

Usergroup: Customer
Joined: Aug 05, 2005

Total Topics: 94
Total Comments: 272
2 of 4 people found this comment helpful
Posted Aug 14, 2005 - 10:15 AM:

thx. But I just used {CATNAME} grin

Did it for me
capitaine
Forum Regular

Usergroup: Customer
Joined: Aug 05, 2005

Total Topics: 94
Total Comments: 272
2 of 4 people found this comment helpful
Posted Aug 23, 2005 - 3:40 PM:

the problem I now have is that the image code will fire up even for the sub-categories... and the images are only for the category level. So you get the red cross, as there's no associated image for a sub-cat..

is there a way to get the image to only display for the categories and not the sub-cats? Some sort of conditional perhaps: if category is top-level, then show image, otherwise dont... ??
Olney
Member

Usergroup: Customer
Joined: Oct 30, 2004

Total Topics: 18
Total Comments: 47
Olney
2 of 4 people found this comment helpful
Posted Aug 23, 2005 - 3:55 PM:

I'd suggest using lots of conditional statements

<IF {CATNAME} is Entertainment><img src="{CATID).gif" />{CATNAME}
<IF {CATNAME} is Sports><img src="{CATID).gif" />{CATNAME}
<IF {CATNAME} is Hot Rides><img src="{CATID).gif" />{CATNAME}
<OTHERWISE>
{CATNAME}
</IF>

If it's just the main categories there shouldn't be a ton I think.
This might be what you are looking for...
capitaine
Forum Regular

Usergroup: Customer
Joined: Aug 05, 2005

Total Topics: 94
Total Comments: 272
2 of 4 people found this comment helpful
Posted Aug 23, 2005 - 4:13 PM:

that's not going to work... there's over 50 top-level categories....
Olney
Member

Usergroup: Customer
Joined: Oct 30, 2004

Total Topics: 18
Total Comments: 47
Olney
2 of 4 people found this comment helpful
Posted Aug 23, 2005 - 5:01 PM:

Make a new field call top (a category field)

do something like this

Create a check mark for your top categories
Make sure your directory can automatically add this to the template
When you create a top category click the box


<IF {CATTOP} is yes><img src="{CATID).gif" />{CATNAME}
<OTHERWISE>
{CATNAME}


And the other way should work even if you have 50 categories you just need to manually do it.

Did you try it & did it slow down your category page?

Other than that you may have to search the manual for a better variable.
Paul has the best online documentation of any software my company has bought.


Actually the thread that Paul referred you to would work. You just have to manually upload an image for each & only the categories you want.
You might have to change the second part of the IF statement to do what you want.

capitaine
Forum Regular

Usergroup: Customer
Joined: Aug 05, 2005

Total Topics: 94
Total Comments: 272
2 of 4 people found this comment helpful
Posted Aug 25, 2005 - 3:28 PM:

well I created a new field, of checkbox type, and I can see it in the webpage and its fine. But the IF statement doesn't work.... I have the checkbox checked, and I tried using: <IF {CATTOP} is checked> and also <IF {CATTOP} is yes> but neither works....

So what is the correct way to call this in the IF statement if you're using checkboxes...?
Olney
Member

Usergroup: Customer
Joined: Oct 30, 2004

Total Topics: 18
Total Comments: 47
Olney
2 of 4 people found this comment helpful
Posted Aug 25, 2005 - 7:42 PM:

I believe it's just <IF {CATTOP}> or <IF {CATTOP} is 1>
capitaine
Forum Regular

Usergroup: Customer
Joined: Aug 05, 2005

Total Topics: 94
Total Comments: 272
#10 - Quote - Permalink
2 of 4 people found this comment helpful
Posted Aug 26, 2005 - 4:44 PM:

yep, its just <IF {CATTOP}>

cheers!
Search thread for
Download thread as
  • 0/5
  • 1
  • 2
  • 3
  • 4
  • 5



This thread is closed, so you cannot post a reply.