| Author |
Message |
mralikorn

Joined: Oct 07, 2008
Posts: 32
|
Posted:
Sun Feb 08, 2009 4:18 pm |
|
Q? Where would i Look to modify how many products to show in 1 row on the main page. Right now it shows 2 across. I would like to show more than that. right now my icons are small and it waste alot of space on the page. I know its in the main.tpl just cant finde the specific one. Thanks |
| |
|
|
 |
gotcha
Site Admin


Joined: Oct 25, 2004
Posts: 921
|
Posted:
Sun Feb 08, 2009 7:31 pm |
|
Well the more you add, the more complicated it will get. But lets say you want 4 across... The first part to look at is:
NOTE: The forum stripped out all the width="50%" from the td tags, so just pretend they are there. You should be able to see what I mean when you are looking through the template.
| Code: |
<table>
<tr>
<td>
{foreach from=$item_array name=itm item=item} |
Before the foreach loop we have an open td set at 50%. Change it to 25%
Next you want to scroll down toward the bottom. Now we have:
| Code: |
{if $smarty.foreach.itm.iteration is odd}
</td><td>
{/if} |
That one will need a couple of changes. The first is the part [b]is odd.
That will make a new column after one column but you want this to happen three times before starting a new row. So change is odd to is not div by 4 and change the width to 25% so you end up with
| Code: |
{if $smarty.foreach.itm.iteration is not div by 4}
</td><td>
{/if} |
Now move down a bit to this code
| Code: |
{if $smarty.foreach.itm.iteration is even && $smarty.foreach.itm.total != $smarty.foreach.itm.iteration}
</td></tr>
<tr>
<td>
{/if} |
The first thing to look at is the part is even. That is that part that makes it go to a new row. but now we want it to to this after the 4th item, so we change it to is div by 4 and set the width to 25% again so you end up with
| Code: |
{if $smarty.foreach.itm.iteration is div by 4 && $smarty.foreach.itm.total != $smarty.foreach.itm.iteration}
</td></tr>
<tr>
<td>
{/if} |
And that should do it. Let me know if there are any problems with this little howto. To adapt it to show 3 per row, you should be able to just column widths to 33% and change the 4's to 3's. |
| |
|
|
 |
mralikorn

Joined: Oct 07, 2008
Posts: 32
|
Posted:
Sun Feb 08, 2009 11:35 pm |
|
Thanks so much For all the help I know that i am a pain. |
| |
|
|
 |
|
|