Thread: Embed Sitemap
View Single Post
  #4  
Old 10-07-2011, 11:34 AM
 
makenoiz makenoiz is offline
 

Advanced Member
  
Join Date: Jun 2011
Posts: 35
 

Default Re: Embed Sitemap

I have the loop there... but I cant get into the loop. I think they varibale for Subcats has changed?. WOuld this be the right syntax for the second level sub cats? {if $subcat.subcats gt 0} or is it something like $subcats.childs ?

Here is my full code - it Breaks where you see the Breaks Comment

<ul class="subcategories">
{foreach from=$categories item=subcat name=subcategories}
<br />
<a href="home.php?cat={$subcat.categoryid}">{$subcat. category|escape}</a> {* list 1st level subcategories This works!*}
{if $subcat.subcats gt 0 }
{*Breaks HERE Cant get into the for each loop*}
{foreach from=$subcat.subcats item=subcat2 name=subcat2}{* list 2nd level subcategories *}
<br/><a href="home.php?cat={$subcat2.categoryid}">--{$subcat2.category|escape}</a>
{if $subcat2.categoryid eq $current_category.parentid}
{assign var='parent_category' value=$subcat2.category}{* get the name of the Parent Category *}
{/if}

{if $subcat2.subcats gt 0}
{foreach from=$subcat2.subcats item=subcat3 name=subcat3}{* list 3rd level subcategories *}
{if $subcat3.parentid eq $current_category.parentid}
<a href="home.php?cat={$subcat3.categoryid}">{$subcat 3.category }</a><br />
{/if}
{/foreach}
{/if}
{/foreach}
{/if}
</li>
{/foreach}
</ul>


Thanks
__________________
X-Cart version 4.4.3
Reply With Quote