Hi everyone, I am a newbie to these forums. Hope I follow etiquette correctly.
My issue:
When I'm pulling in data from the database, the data for "Description" doesn't show up. Here is my code:
Code:
{capture name=dialog}
{assign var="tmp" value="0"}
{foreach from=$subcategories item=c key=catid}
{if $c.category}{assign var="tmp" value="1"}{/if}
{/foreach}
{if $subcategories}
<ul id="subcategories">
{foreach from=$subcategories item=subcat}
<li>
{*{if $tmp and $first_subcat ne "Y"}
<td valign="top" rowspan="{count value=$subcategories print="Y"}"><img src="{if $current_category.icon_url}{$current_category.icon_url}{else}{$xcart_web_dir}/image.php?id={$cat}&type=C{/if}" alt="" /></td>
{assign var="first_subcat" value="Y"}
{/if}*}
<a href="home.php?cat={ $subcat.categoryid }"><img src="{$xcart_web_dir}/image.php?id={$subcat.categoryid}&type=C" alt="" class="p_img" /></a>
<p class="subcategory_p_title"><a href="home.php?cat={ $subcat.categoryid }">{ $subcat.category|escape }</a></p>
<p class="subcategory_p_desc">{$subcat.description|escape}</p>
</li>
{/foreach}
</ul>
{/if}
The "{$subcat.description|escape}" isn't working, though the database is populated in that field. Is there a special way to pull in that data that isn't obvious? The other ones ({$subcat.categoryid}, etc) pull data fine.
I also tried a mod found here (
http://forum.x-cart.com/showthread.php?t=384
, changing it a bit to make it a <ul>, not changing the data structure though. It doesn't pull any data at all. Here's the code to that mod:
Code:
{capture name=dialog}
{assign var="tmp" value="0"}
{section name=cat_num loop=$subcategories}
{if $subcategories[cat_num].category}{assign var="tmp" value="1"}{/if}
{/section}
<ul id="subcategories">
{section name=cat_num loop=$subcategories}
<li>
<a href="home.php?cat={$subcategories[cat_num].categoryid}"><img src="{$xcart_web_dir}/image.php?id={$subcategories[cat_num].categoryid}&type=C" alt="" class="p_img" /></a>
<p class="subcategory_p_title"><a href="home.php?cat={$subcategories[cat_num].categoryid}">{$subcategories[cat_num].category|escape}</a></p>
<p class="subcategory_p_desc">{$categories[cat_num].description|escape}</p>
</li>
{/section}
</ul>
Any ideas would be, of course, appreciated.
Thanks