Limiting News Items

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
BlueLaw
Forum Members
Forum Members
Posts: 42
Joined: Wed Jan 02, 2008 10:27 pm

Limiting News Items

Post by BlueLaw »

Hi, I'm sure this has been covered but I don't seem to be able to find out where...

I have 2 news blocks, one on the HOME PAGE and one on a NEWS PAGE.

I want the one on my home page to be limited to 3 news items,

and I want the one on my news page to list ALL of my news items.

If I use the parameter number="3" then you get the awkward arrows, like this: "Page 1 of 2  > >>"

- Which I really don't want, instead I just want 3 items, and that's it.

Let me know if you've got the code, I've been working on this for too long now, many thanks in advance.
Zoorlat

Re: Limiting News Items

Post by Zoorlat »

Pagination is set in the summary template. Just edit your summary template if you want to change it. On the top of the sample (default) template you'll see something like:

Code: Select all

{if $pagecount > 1}
  <p>
{if $pagenumber > 1}
{$firstpage} {$prevpage} 
{/if}
{$pagetext} {$pagenumber} {$oftext} {$pagecount}
{if $pagenumber < $pagecount}
 {$nextpage} {$lastpage}
{/if}
</p>
{/if}
Simply create a new template without that stuff if you do not want the pagination. Remember to use summarytemplate="nameofyourtemplate" in the {news}-tag if you want to use your custom no-pagination-template.

For more, see this thread: http://forum.cmsmadesimple.org/index.php?topic=16684.msg82513
User avatar
gemini
Forum Members
Forum Members
Posts: 19
Joined: Mon Nov 17, 2008 4:17 pm

Re: Limiting News Items

Post by gemini »

And about those news.. almost the same problem here. I want to show only one news article on homepage and detailed straight away. When you add {news...} first you see summary, then you have to click on more, to see detailed view. I want that detailed view straight away.
Zoorlat

Re: Limiting News Items

Post by Zoorlat »

@gemini Also this you can do by modifying the summary template. Simply change the default template (or create a new one) and use {eval var=$entry->content} where you want to insert the content of a news item.

If you look closer at the default template, you'll see how it works and what other tags you can use (for summary, extra, date, category, etc).

Good luck!
User avatar
gemini
Forum Members
Forum Members
Posts: 19
Joined: Mon Nov 17, 2008 4:17 pm

Re: Limiting News Items

Post by gemini »

This one solved i think ;]
Post Reply

Return to “Modules/Add-Ons”