View Full Version : phpld3 Detect if in subcategory
rayovac
04-08-2006, 11:00 AM
I'm waiting on access to the phpld3 support area. Paid for it and sent PM.
While waiting for access, I have a question.
I want to construct a statement like:
{if (WithInAsubCategory)}
...display some html here
{/if}
Is there an existing variable that determines if you are in a subcategory?
What I'm trying to do is, create a breadcrumb trail, but I don't want it to display on the main index page.
rayovac
04-08-2006, 11:59 PM
Thanks. Do you know of any others? When I try:
{php}
echo "cat.subcats = " . $cat.SUBCATS;
{/php}
The following is displayed on the index, as well as subcategory pages:
cat.subcats = SUBCATS
I'm not able to detect whether within subcategories with this.
That's because you're in php, and trying to reference a $smarty variable. that's a no no.
{if $cat.SUBCATS}
do this stuff in here
{/if}
rayovac
04-09-2006, 04:58 AM
Thanks for your reply. I replaced my code above with:
Content visible to registered users only.
for a simple test, and do not get the "xxxxxxxxx" in either the index or in a subcategory page. I also checked the source of each. I placed it in the top_bar.tpl file, at the very bottom of the page/code.
I've also tried:
Content visible to registered users only.
and the value = is null (blank):
Content visible to registered users only.
I appreciate your suggestions and help.
rayovac
04-09-2006, 08:15 PM
I've found something that works for what I was trying to do:
Content visible to registered users only.
Content visible to registered users only.
in that case:
Content visible to registered users only.
which would mean you are on level 2(within a parent category parent_id's are 0(zero)) within the directory.
rayovac
04-09-2006, 08:48 PM
Hey, that's even better!
Thanks very much for your help, anon!
no prob. anytime!
Sometimes it's hard to really understand what +a person is aiming for. That can be due to several reasons: 1. my brain currently frying 2. im too wrapped up into my template 3. lack of sleep 4. sometimes the poster doesn't come across quite clear enough for me to truly understand.
In the end, it always works out though ;)
Good luck with everything. Hope to see lots and lots of successful directories while i'm around.(which will be a long time :D)
vBulletin® v3.8.0, Copyright ©2000-2012, Jelsoft Enterprises Ltd.