Topic: How to display only the last 10 ads?
Hello,
latest_frontpage.tpl displays all ads from database sorting them by ad_date by default.
I think, sorting all ads causes slowing the front page. I want to display only last 10 ads in frontpage. When I do this, I will remove next - Prev buttons.
These are the line from latest_frontpage.tpl :
Could you please tell me how to control foreach loop for the last 10 ads?
...
{foreach item=ad from=$ads}
<tr class="{cycle values=",alt"}">
<td class="category">{$ad.CATEGORYNAME}</td>
<td class="pointer"><a href="{$ad.LINK}" title="{$ad.TITLE|escape}">
{if $ad.SPECIAL}<b>{/if}{$ad.TITLE|truncate:35:"...":true}{if $ad.SPECIAL}</b>{/if}</a></td>
{foreach item=extraval from=$ad.EXTRA_VALUES}
<td><nobr>{$extraval|truncate:20:"...":true}</nobr></td>
{/foreach}
<td>{$ad.EXPIREDATE}</td>
<!-- <td>{if $ad.VENDOR_URL}<img src="{$ad.VENDOR_URL}" height="30" />{/if}</td> -->
<td>{$ad.GRADE}</td>
<td>{$ad.IMAGEYESNO}</td>
</tr>
{/foreach}
...
Thank you for your help.
Osman