X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   Unique text on category template? (https://forum.x-cart.com/showthread.php?t=8907)

RJC 08-13-2004 07:22 AM

Unique text on category template?
 
I apologize if this has been addressed before, but I couldn't find anything here on the boards...

Let's say I have a category called Fruit. If I wanted to display a message on that page utilizing the category name, I would add "Look at our wonderful selection of {$current_category.category} on the customer/home.tpl. Obviously, this would appear on all categories, whether they were fruit, cars, books etc.

Now, if under Fruit I have a sub-category "Apples," the problem I am having is that message is displaying there as well, so the message "Look at our wonderful selection of Apples" would print on the sub-category page..which I don't want.

How could I either:

1. Not have this message appear at all on the sub-category's page or

2. Have this line pull the name of the parent category, so it would still say "Fruit" and not "Apples."

Am I putting this line on the wrong template to begin with? I'm new to Smarty (obviously), and am confused as hell!!

I am currently testing version 4.0.2. Thanks in advance!

Rich

shan 08-16-2004 12:43 PM

you should make use of the array that builds the navigation menu.

Code:

{$location[0].0}

That will give you the name of the main root category

RJC 08-16-2004 12:49 PM

Thanks for the reply...this was one of those things that I figured out about 10 minutes after I posted this (and about 4 hours of banging my head off the desk before that..). I actually did it a bit differently, creating and calling an alternate template (home1.tpl) and php file (home1.php). Works like a charm, though I guess I could have done it in an easier fashion #-o


All times are GMT -8. The time now is 01:42 PM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.