Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

Embed Sitemap

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 10-06-2011, 09:03 PM
 
makenoiz makenoiz is offline
 

Advanced Member
  
Join Date: Jun 2011
Posts: 35
 

Default 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!
__________________
X-Cart version 4.4.3
Reply With Quote
  #2  
Old 10-07-2011, 12:31 AM
 
makenoiz makenoiz is offline
 

Advanced Member
  
Join Date: Jun 2011
Posts: 35
 

Default 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
__________________
X-Cart version 4.4.3
Reply With Quote
  #3  
Old 10-07-2011, 04:34 AM
  cflsystems's Avatar 
cflsystems cflsystems is offline
 

Veteran
  
Join Date: Apr 2007
Posts: 14,201
 

Default Re: Embed Sitemap

If subcats is an array you have to loop through it as well
__________________
Steve Stoyanov
CFLSystems.com
Web Development
Reply With Quote
  #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
  #5  
Old 10-07-2011, 02:52 PM
  cflsystems's Avatar 
cflsystems cflsystems is offline
 

Veteran
  
Join Date: Apr 2007
Posts: 14,201
 

Default Re: Embed Sitemap

use the debug window to find what the right name for the "subcats" is. Could be childs
__________________
Steve Stoyanov
CFLSystems.com
Web Development
Reply With Quote
  #6  
Old 10-11-2011, 05:38 PM
 
makenoiz makenoiz is offline
 

Advanced Member
  
Join Date: Jun 2011
Posts: 35
 

Default Re: Embed Sitemap

Does not show what it should be.... thanks tho!
__________________
X-Cart version 4.4.3
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 01:17 PM.

   

 
X-Cart forums © 2001-2020