| ||||||||||
| Shopping cart software Solutions for online shops and malls | ||||||||||
| 
 | 
||||||||||
| X-Cart Home | 
Embed Sitemap | |||
![]()  | 
	
	
		
			 | 	
	
||
| 
		 | 
	Thread Tools | Search this Thread | 
| 
		 
			 
			#1  
			
			
			
			
		 
		
		
	 | 
|||||||
		
		
  | 
|||||||
| 
	
	
		
        	 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  | 
|||||||
| 
		 
			 
			#2  
			
			
			
			
		 
		
		
	 | 
|||||||
		
		
  | 
|||||||
| 
	
	
		
        	 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  | 
|||||||
| 
		 
			 
			#3  
			
			
			
			
		 
		
		
	 | 
|||||||||
		
		
  | 
|||||||||
| 
	
	
		
        	 If subcats is an array you have to loop through it as well 
		
	
		
		
		
		
			
				__________________ 
		
		
		
		
	
		
		
		
	Steve Stoyanov CFLSystems.com Web Development  | 
|||||||||
| 
		 
			 
			#4  
			
			
			
			
		 
		
		
	 | 
|||||||
		
		
  | 
|||||||
| 
	
	
		
        	 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  | 
|||||||
| 
		 
			 
			#5  
			
			
			
			
		 
		
		
	 | 
|||||||||
		
		
  | 
|||||||||
| 
	
	
		
        	 use the debug window to find what the right name for the "subcats" is. Could be childs 
		
	
		
		
		
		
			
				__________________ 
		
		
		
		
	
		
		
		
	Steve Stoyanov CFLSystems.com Web Development  | 
|||||||||
| 
		 
			 
			#6  
			
			
			
			
		 
		
		
	 | 
|||||||
		
		
  | 
|||||||
| 
	
	
		
        	 Does not show what it should be....  thanks tho! 
		
	
		
		
		
		
			
				__________________ 
		
		
		
		
	
		
		
		
	X-Cart version 4.4.3  | 
|||||||
| 
 | 
|||
| 
 
X-Cart forums © 2001-2020
 
 | 
|||