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)
-   -   Calling an additional field as part of the category array (https://forum.x-cart.com/showthread.php?t=44261)

balinor 12-16-2008 05:52 AM

Calling an additional field as part of the category array
 
Here's one I can't seem to work out - I created an additional field for categories, sort of like a second category title. I need to use this as a sub-title for the side menu categories. I can successfully get it to display on the category page using {$current_category.subtitle}, but I can't seem to get it to show under the side menu links. Here's the code:

Code:

{foreach from=$categories item=c}
<div class="CategoriesList"><a href="home.php?cat={$c.categoryid}" class="VertMenuItems">{$c.category}</a></div>
<div class="CategoriesListSub">{$c.subtitle}</div>
{/foreach}


Do I somehow need to specify this additional field in categories.php or am I just missing something obvious from staring at this for hours? :)

Vetrivel 12-16-2008 09:02 AM

Re: Calling an additional field as part of the category array
 
Hi balinor,
yes you need to specify it in include/categories.php
In function ->func_get_categories_list
in the below mentioned line.
if ($short_list) {
$to_search = "$sql_tbl[categories].subtitle,$sql_tbl[categories].categoryid,

:D/ :D/ :D/

Quote:

Originally Posted by balinor
Here's one I can't seem to work out - I created an additional field for categories, sort of like a second category title. I need to use this as a sub-title for the side menu categories. I can successfully get it to display on the category page using {$current_category.subtitle}, but I can't seem to get it to show under the side menu links. Here's the code:

Code:

{foreach from=$categories item=c}
<div class="CategoriesList"><a href="home.php?cat={$c.categoryid}" class="VertMenuItems">{$c.category}</a></div>
<div class="CategoriesListSub">{$c.subtitle}</div>
{/foreach}


Do I somehow need to specify this additional field in categories.php or am I just missing something obvious from staring at this for hours? :)


balinor 12-16-2008 09:10 AM

Re: Calling an additional field as part of the category array
 
Woo hoo! Thanks for the tip!

Vetrivel 12-16-2008 09:29 AM

Re: Calling an additional field as part of the category array
 
Its my pleasure to help such a great person like you(POST:25,180). :lol: :D :D/
Have a nice day.
Season greeting.
Quote:

Originally Posted by balinor
Woo hoo! Thanks for the tip!



All times are GMT -8. The time now is 11:27 AM.

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