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

breadcrumb code

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 07-16-2007, 01:25 PM
 
luxor luxor is offline
 

Senior Member
  
Join Date: Apr 2007
Posts: 120
 

Default breadcrumb code

can anyone explain how

Code:
{* $Id: location.tpl,v 1.14.2.2 2007/06/18 11:42:03 max Exp $ *} {if $location} <font class="NavigationPath"> {strip} {section name=position loop=$location} {if $location[position].1 ne "" }<a href="{$location[position].1|amp}" class="NavigationPath">{/if} {$location[position].0} {if $location[position].1 ne "" }</a>{/if} {if not %position.last%} &nbsp;>&nbsp; {/if} {/section} {/strip} </font> <br /><br /> {/if}

produces:

Code:
<font class="NavigationPath"> <a href="home.php" class="NavigationPath">My Store</a> &nbsp;>&nbsp; <a href="bed-c-4.html" class="NavigationPath" title="Bed">Bed</a> &nbsp;>&nbsp; Product Name</font> <br /><br />
__________________
v4.1.8 GOLD
Reply With Quote
  #2  
Old 07-19-2007, 11:01 AM
 
William William is offline
 

Member
  
Join Date: Sep 2006
Posts: 20
 

Default Re: breadcrumb code

By asking if $location is true, then open a deprecated FONT element with thea class of NaviagtionPath, then {strip} all the white space in the following $location loop then close the deprecated FONT element then add two line break elements, then close the conditional $location question/logic. Is this what you meant?
__________________
X-Cart version 4.1.7 (unix)
Reply With Quote
  #3  
Old 07-19-2007, 11:08 AM
 
luxor luxor is offline
 

Senior Member
  
Join Date: Apr 2007
Posts: 120
 

Default Re: breadcrumb code

I can see very clearly what you have said.

I do not understand this :

Code:
{section name=position loop=$location} {if $location[position].1 ne "" }<a href="{$location[position].1|amp}" class="NavigationPath">{/if} {$location[position].0} {if $location[position].1 ne "" }</a>{/if} {if not %position.last%} &nbsp;>&nbsp; {/if} {/section}
__________________
v4.1.8 GOLD
Reply With Quote
  #4  
Old 07-19-2007, 11:36 AM
 
William William is offline
 

Member
  
Join Date: Sep 2006
Posts: 20
 

Default Re: breadcrumb code

well, that's all the fun stuff there!

{section} starts the loop and it's named position and it's trying to figure out where the user's location is in the application. if the $location[position].1 is not where you're at, then it starts an anchor. Otherwise, it's just text, {$location[position].0}. Then it does that logic again to see if it needs to close the anchor.

There's also another post here where they talk more about how to modify this bit of code.

How well did this answer your question?
__________________
X-Cart version 4.1.7 (unix)
Reply With Quote
  #5  
Old 07-19-2007, 11:55 AM
 
luxor luxor is offline
 

Senior Member
  
Join Date: Apr 2007
Posts: 120
 

Default Re: breadcrumb code

Your answers are extremely enlightening! Thanks a lot.


$location is an array of of location strings?


{section name=position loop=$location}

What is the purpose of section in smarty? loop = $location means to read through elements of the array $location?

this loop is sort of like a built in function to obtain the length of the location variable?



{if $location[position].1 ne "" }<a href="{$location[position].1|amp}" class="NavigationPath">{/if}

if $location[position].1 ne "" mean if not equal to NULL, then print the location variable position with the anchor html code.

what does the .1 mean in $location[position].1 ?

what does the |amp mean in $location[position].1|amp ?

{$location[position].0}

-now what does the .0 mean ?


{if $location[position].1 ne "" }</a>{/if}
{if not %position.last%} &nbsp;>&nbsp; {/if}
{/section}

i do not understand %position.last% , the % character meaning here.
__________________
v4.1.8 GOLD
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 03:36 PM.

   

 
X-Cart forums © 2001-2020