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)
-   -   Embed Sitemap (https://forum.x-cart.com/showthread.php?t=61136)

makenoiz 10-06-2011 09:03 PM

Embed Sitemap
 
I would like to embed a site map on the subcategory.tpl but to run the sitemap you have to call sitemap.php.

How can I embed this into a tpl?

Thank you for any advice!

makenoiz 10-07-2011 12:31 AM

Re: Embed Sitemap
 
OK so Ive been working on this and I have a code problem. if you look at the code below you will see "debug 22" I cant seem to get into the foreach look. Is my syntax for the foreach loop incorrect? I do have subcats.....

{foreach from=$categories item=subcat name=subcategories}
debug<a href="home.php?cat={$subcat.categoryid}">{$subcat. category|escape}</a>

{if $subcat.subcats gt 0}
debug 22

cflsystems 10-07-2011 04:34 AM

Re: Embed Sitemap
 
If subcats is an array you have to loop through it as well

makenoiz 10-07-2011 11:34 AM

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

cflsystems 10-07-2011 02:52 PM

Re: Embed Sitemap
 
use the debug window to find what the right name for the "subcats" is. Could be childs

makenoiz 10-11-2011 05:38 PM

Re: Embed Sitemap
 
Does not show what it should be.... thanks tho!


All times are GMT -8. The time now is 12:07 AM.

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