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

Hiding Code in Section

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 09-16-2006, 07:18 PM
  dalmuti's Avatar 
dalmuti dalmuti is offline
 

eXpert
  
Join Date: Oct 2004
Location: Kansas
Posts: 343
 

Default Hiding Code in Section

I am trying to add a space between each tab for a speedbar. I read other code and tried copying the idea and would like the space between tabs unless its the last tab and then no space because its right aligned and leaves a space and looks strange.

Here is the code:

Quote:
{if $speed_bar}
<TABLE border="0" cellpadding="0" cellspacing="0">
<TR>
{section name=sb loop=$speed_bar}
{if $speed_bar[sb].active eq "Y"}
<TD>{include file="customer/tab.tpl" tab_title="<A href=\"`$speed_bar[sb].link`\">`$speed_bar[sb].title`</A>"}</TD>
{if not %sb.last%}
<TD width="2"><IMG src="{$ImagesDir}/spacer.gif" width="2" height="1" border="0" alt=""></TD>
{/if}
{/if}
{/section}
</TR>
</TABLE>
{/if}

What am I doing wrong?

Thanks,

Louise
__________________
Louise

Studio 57 Designs - X-Cart Customization
Providing X-Cart Services since 2004
Hottest Blog Directory - Submit Your Blog for a Free Listing
Reply With Quote
  #2  
Old 09-18-2006, 06:59 AM
 
willirl willirl is offline
 

eXpert
  
Join Date: Mar 2004
Location: OHIO
Posts: 271
 

Default Re: Hiding Code in Section

(Assuming that the TD code is correct) - If the last element(s) of the speed bar is(are) not active ("Y") then there will be a space after the last tab. I don't see a way to make it work in this case without doing a two pass type loop where you get the "active" tabs on the first pass then diisplay them on the second.
__________________
Richard

x-cart version 4.0.17
http://roguewavemarine.com
Reply With Quote
  #3  
Old 09-18-2006, 07:31 AM
  dalmuti's Avatar 
dalmuti dalmuti is offline
 

eXpert
  
Join Date: Oct 2004
Location: Kansas
Posts: 343
 

Default Re: Hiding Code in Section

That was it....I wasn't thinking about the last item not being active. Thank you for your reply.

Louise
__________________
Louise

Studio 57 Designs - X-Cart Customization
Providing X-Cart Services since 2004
Hottest Blog Directory - Submit Your Blog for a Free Listing
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 05:49 AM.

   

 
X-Cart forums © 2001-2020