Heyho,
how to display the latest 5 news with the news addon on another page? I tried pagelimit and number, but this doesn't work since the pagination id being displayed ....
Thanks
Latest 5 News
Re: Latest 5 News
In the news summary template, the following part displays the pagination :Hereistos wrote: I tried pagelimit and number, but this doesn't work since the pagination id being displayed ....
Code: Select all
{if $pagecount > 1}
<p>
{if $pagenumber > 1}
{$firstpage} {$prevpage}
{/if}
{$pagetext} {$pagenumber} {$oftext} {$pagecount}
{if $pagenumber < $pagecount}
{$nextpage} {$lastpage}
{/if}
Re: Latest 5 News
If you mean to display the selected one on another page,
{news number=5 detailpage="alias-of-the-targetedpage"}
This will show 5 news-summaries, clicking one, will open it in the page with the alias mentioned in the detailpage-parameter.
Ronny
{news number=5 detailpage="alias-of-the-targetedpage"}
This will show 5 news-summaries, clicking one, will open it in the page with the alias mentioned in the detailpage-parameter.
Ronny
- DirtyMusic
- Forum Members
- Posts: 15
- Joined: Sat Nov 08, 2008 9:27 am
Re: Latest 5 News
Make a "Latest 5 News"
Go to "News" --> "Summarytemplates" and click "Create a new template" and name it: Newslatest
Copy and paste this code:
Then go to the page where you want the latest news and add this code:
Go to "News" --> "Summarytemplates" and click "Create a new template" and name it: Newslatest
Copy and paste this code:
Code: Select all
{foreach from=$items item=entry}
<div class="NewsSummary">
{if $entry->postdate}
<div class="NewsSummaryPostdate">
{$entry->postdate|cms_date_format}
</div>
{/if}
<div class="NewsSummaryLink">
<a href="{$entry->moreurl}" title="{$entry->title|cms_escape:htmlall}">{$entry->title|cms_escape}</a>
</div>
<div class="NewsSummaryCategory">
{$category_label} {$entry->category}
</div>
{if $entry->author}
<div class="NewsSummaryAuthor">
{$author_label} {$entry->author}
</div>
{/if}
{if $entry->summary}
<div class="NewsSummarySummary">
{eval var=$entry->summary}
</div>
<div class="NewsSummaryMorelink">
[{$entry->morelink}]
</div>
{else if $entry->content}
<div class="NewsSummaryContent">
{eval var=$entry->content}
</div>
{/if}
{if isset($entry->extra)}
<div class="NewsSummaryExtra">
{eval var=$entry->extra}
{* {cms_module module='Uploads' mode='simpleurl' upload_id=$entry->extravalue} *}
</div>
{/if}
{if isset($entry->fields)}
{foreach from=$entry->fields item='field'}
<div class="NewsSummaryField">
{if $field->type == 'file'}
<img src="{$entry->file_location}/{$field->value}"/>
{else}
{$field->name}: {eval var=$field->value}
{/if}
</div>
{/foreach}
{/if}
</div>
{/foreach}
Code: Select all
{news number='5' summarytemplate='Newslatest'}