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

Display the Bestsellers List as a list format

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 09-17-2007, 01:46 AM
 
jth jth is offline
 

Newbie
  
Join Date: Jul 2007
Posts: 5
 

Question Display the Bestsellers List as a list format

Hi,

I would like to display the Bestsellers List as a normal ordered list <ol><li></li></ol>, instead of the way it displays now with the text wrapping to the edge of the page, under the numbers.

Is this possible?

This is the way it displays by default:

1. This is the first bestseller
2. This is another bestseller that
goes on to the next line.
3. Yet another besteseller that is
on the next line

This is the way I like it to display:
  1. This is the first bestseller
  2. This is another bestseller that goes on to the next line. This is another bestseller that goes on to the next line. This is another bestseller that goes on to the next line. This is another bestseller that goes on to the next line.This is another bestseller that goes on to the next line. This is another bestseller that goes on to the next line.
  3. Yet another bestseller that is on the next line. Yet another bestseller that is on the next line. Yet another bestseller that is on the next line. Yet another bestseller that is on the next line.Yet another bestseller that is on the next line. Yet another bestseller that is on the next line.
Does anyone know how to do this?

Thanks,

Jo
__________________
pws
X-Cart version 4.1.8
Reply With Quote
  #2  
Old 09-17-2007, 04:13 AM
 
carpeperdiem carpeperdiem is offline
 

X-Guru
  
Join Date: Jul 2006
Location: New York City, USA
Posts: 5,399
 

Default Re: Display the Bestsellers List as a list format

Jo,

Before I suggest a solution, please do some housekeeping and update your forum sig with your correct version of xcart -- your fourm sig states, "4.1.18" -- not a valid version of xcart -- is it 4.1.8 or 4.0.18? I will suggest a solution for 4.1.8.

OK -- in /skin1/modules/Bestsellers/menu_bestsellers.tpl

find this code:

Code:
{section name=num loop=$bestsellers} <font class="VertMenuItems"><b>{math equation="value+1" value=$smarty.section.num.index}.</b></font> <a href="product.php?productid={$bestsellers[num].productid}&amp;cat={$cat}&amp;bestseller=Y" class="VertMenuItems">{$bestsellers[num].product}</a><br /> {/section}

Notice the {section name=num loop=$bestsellers} -- and the {/section} ???

That's your loop for the items.

Just thinking out loud:

Could you start the <ol> before the loop, and close it after? I think you could. Maybe this:

Code:
<ol> {section name=num loop=$bestsellers} <li><a href="product.php?productid={$bestsellers[num].productid}&amp;cat={$cat}&amp;bestseller=Y" class="VertMenuItems">{$bestsellers[num].product}</a></li> {/section} </ol>

Notice, I took out the "numbering" function - if you're using a <ul><li> then this is not really needed, is it?: <font class="VertMenuItems"><b>{math equation="value+1" value=$smarty.section.num.index}.</b></font>

I think this will do what you want.

The only drawback is loss of control on the formatting. By doing it the x-cart way, you can use a CSS class to be very specific on linebreaks, etc. Using <ol> may be the better solution?? Please report back! I'm just thinking out loud, so I may be way off here... Hope this helps,

Jeremy
__________________
xcart 4.5.4 gold+ w/x-payments 1.0.6; xcart gold 4.4.4
Reply With Quote
  #3  
Old 09-17-2007, 06:18 AM
 
jth jth is offline
 

Newbie
  
Join Date: Jul 2007
Posts: 5
 

Default Re: Display the Bestsellers List as a list format

Hi Jeremy,

You were spot on.

Well Done! Worked perfectly.

Just had to adjust the "ol" styling and everything is great.

Your help and advise is much appreciated.

Thanks!

Jo
__________________
pws
X-Cart version 4.1.8
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:12 PM.

   

 
X-Cart forums © 2001-2020