View Full Version : template conditional questions
March 23rd, 2005, 05:54 AM
Lets say i have the page: showimage.php?i=83
from that info, i want to make a template conditional that checks if one of its parent categories is a certain category.
PATH: Printables > Animals > Color > image83.jpg
can i make a template conditional that checks if this image is in the "Printables" category?
IF so, how?
March 23rd, 2005, 08:51 AM
Look in your showimage.php file for this:
Replace witht this:
Then you'll be able to use $image['parent'] in your if condition.
March 23rd, 2005, 06:48 PM
Thanks, i'll give that a try
March 24th, 2005, 05:06 AM
That gives me the id for the immediate parent. but what if i am a few categories deep and i need to know what the upper most parent is? is that possible?
for example, if i am here:
Printables > Animals > Color > image83.jpg
how can i find the id for Printables, not Color?
March 24th, 2005, 08:59 AM
Not sure that can be done with an if condition.
March 24th, 2005, 09:00 AM
ok, thanks. no big deal. :)
March 24th, 2005, 01:56 PM
The script is generating the breadcrumb which contains all the category tree IDs... can't you tap into that?
March 24th, 2005, 04:12 PM
good point. is that possible?
March 24th, 2005, 05:58 PM
You'd have to check it with a code hack. Template conditionals don't give you the string functions you'd need.
It would be handy to have a photo's category tree available in an array so it can be used in template conditionals.
vBulletin® v3.8.1, Copyright ©2000-2014, Jelsoft Enterprises Ltd.