![]() |
Link to sub-category in menu
I've created language variables for all my categories, but I don't know how to add a link to a (sub-)categoryto another menu properly.
I used "<li><a href="home.php?cat=47">Horror</a></li>" and this works, but the names are static. What do I need to change so the title of this link automaticaly displays the correct language variable? Thanks, Alexandra |
Re: Link to sub-category in menu
Quote:
Huh? There is no need to make language vars for categories or products. Use Smarty vars to make your links... such as: {$catid} look at the code used in fancy categories for examples. /skin/common_files/modules/Flyout_Menus/Icons/fancy_subcategories.tpl Basically, let xcart (smarty) do the work. |
Re: Link to sub-category in menu
If you mean, displaying a category name in alternative site language in a different place in the page, you could try the following code (I am not sure if this is what you mean):
Code:
{foreach from=$categories_menu_list item=c name=categories} The variable names might differ, according to your xcart version. |
Re: Link to sub-category in menu
Quote:
Thanks for the reply, but although I've checked fancy_subcategories.tpl, I still don't understand how to fix my problem. |
Re: Link to sub-category in menu
Quote:
I just want the sub-categories from category "All Products" to be visible in another menu. I got this to work by adding this: <li><a href="home.php?cat=47">Horror</a></li> <li><a href="home.php?cat=50">Sci-Fi Science Fiction</a></li> <li><a href="home.php?cat=6">Disney</a></li> <li><a href="home.php?cat=40">Music & Dance</a></li> <li><a href="home.php?cat=44">Western</a></li> <li><a href="home.php?cat=48">War</a></li> <li><a href="home.php?cat=42">Martial Arts</a></li> <li><a href="home.php?cat=45">James Bond 007</a></li> <li><a href="home.php?cat=41">Kids & Animation</a></li> <li><a href="home.php?cat=43">(S)exploitation</a></li> <li><a href="home.php?cat=46">Marvel & Superheroes</a></li> <li><a href="home.php?cat=49">Vintage-Classic Pre-1970</a></li> However, I want X-Cart to automaticaly display the corresponding title of that sub-category in the correct language. The way I did it they are the same in all languages. What code do I need to add or replace the above titles with? |
Re: Link to sub-category in menu
In your initial post, you had referred to one specific subcategory with id 47.
If you mean displaying all subcategories in a different place, you could just insert: Quote:
If I missed something, let me know. |
Re: Link to sub-category in menu
Quote:
The specific subcategory with id 47 was used as an example, because I want to be able to add links to specific subcategories. When I try your code it adds a clone of the original categories menu. I just need links to all the sub-categories, minus the first one (All Our Products), from the main category "All Products". |
Re: Link to sub-category in menu
Okay I fixed this problem:
I used "<li><a href="home.php?cat=47">Horror</a></li>" Changed this to: <li><a href="home.php?cat=47">{$lng.lbl_genre_horror}</a></li> Now you can set different titles for all languages and they can be different from the actual category name. Hope someone else can profit from this solution. |
All times are GMT -8. The time now is 11:08 AM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.