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)
-   -   V 4.2 Speed Bar generated in reverse order (https://forum.x-cart.com/showthread.php?t=46939)

sg_web 04-14-2009 11:55 AM

V 4.2 Speed Bar generated in reverse order
 
I'm working on a store using v 4.2. I'm using the speed bar to create a static navigation for the site. For some reason, the list of pages/links gets generated in reverse order and I can't figure out how to correct it.

The code in my home.tpl file looks like this:
Code:

  {if $speed_bar}

      <ul class="subnav">

        {foreach from=$speed_bar item=sb}
          <li><a href="{$sb.link|amp}">{$sb.title}</a></li>
        {/foreach}

      </ul>

  {/if}


And it generates this:

Code:

      <ul class="subnav">
                  <li><a href="pages.php?pageid=12">Contact Us</a></li>
                  <li><a href="#">Order Tracking</a></li>
                  <li><a href="#">Site Map</a></li>
                  <li><a href="pages.php?pageid=11">Policies</a></li>
                  <li><a href="pages.php?pageid=10">Shipping Info</a></li>
                  <li><a href="pages.php?pageid=9">Links</a></li>
                  <li><a href="http://petiteposh.wordpress.com/">Blog</a></li>
                  <li><a href="pages.php?pageid=8">Articles</a></li>
                  <li><a href="pages.php?pageid=7">Questions?</a></li>
                  <li><a href="pages.php?pageid=6">About Us</a></li>
                  <li><a href="home.php">Home</a></li>     
      </ul>


In my x-cart admin, Home is Position 10, About Us is Position 20, Questions? is Position 30, etc.

Is there a setting in the Admin that I need to change to put the list in the right order?

Victor D 04-15-2009 12:49 AM

Re: V 4.2 Speed Bar generated in reverse order
 
it's feature(bug?) of 4.2
It's original skin uses float:right for tabs so they should be putted on the page in reverse order.
you can list tabs in reverse order in template:
Code:

{section loop=$speed_bar name=sb step=-1}
          <a href="{$speed_bar[sb].link|amp}">{$speed_bar[sb].title}</a>
{/section}


sg_web 04-15-2009 03:33 AM

Re: V 4.2 Speed Bar generated in reverse order
 
That is an odd feature (?). Thanks Victor!

2inchesofwater 04-15-2009 03:28 PM

Re: V 4.2 Speed Bar generated in reverse order
 
I've got this problem happening too... the speed bar appears in reverse order on the store front, but in the ADMIN section, the speed bar appears in the correct (original) order! What's even stranger is that both the store front and the admin section both use the same customer/head.tpl code...

My pages don't use CSS float:right. We use CSS text-align:right, so that should remove the need for the speed bar items to be placed in reverse order.

Observation: It almost looks as though the speed bar items are being placed by code into $speed_bar in reverse order for the store front, but placed into $speed_bar in normal (original) order.
Is that correct? If so, that would suggest that $speed_bar is created in two separate locations in the code, and one has been altered to compensate for the CSS float:right instruction. Where can I find one (or both) of the $speed_bar definitions to fix it up?

Cheers,
Dan

Victor D 04-15-2009 11:05 PM

Re: V 4.2 Speed Bar generated in reverse order
 
Customers header with speedbar is in the skin1/customer/head.tpl
Admins one is in skin1/head.tpl
change foreach cycle to section in template according to post #2


All times are GMT -8. The time now is 04:48 PM.

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