[Solved] Client decides the number of news teasers

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Post Reply
Reclus
Forum Members
Forum Members
Posts: 16
Joined: Fri Dec 01, 2006 11:42 pm

[Solved] Client decides the number of news teasers

Post by Reclus »

A client wishes to regularly change the number of news items/teasers shown on the home page.

Is there a way to enable them to do this, perhaps with a field where they can type a number?

Something like…

How many news items to you want to display?
[4]
Last edited by Reclus on Fri Aug 01, 2014 11:48 am, edited 1 time in total.
User avatar
paulbaker
Dev Team Member
Dev Team Member
Posts: 1465
Joined: Sat Apr 18, 2009 10:09 pm
Contact:

Re: Client decides the number of news teasers on the homepag

Post by paulbaker »

Add a category called "Show on home page" and then adjust your module call to show only items in that category?
Jos
Support Guru
Support Guru
Posts: 4019
Joined: Wed Sep 05, 2007 8:03 pm

Re: Client decides the number of news teasers on the homepag

Post by Jos »

Reclus wrote:Is there a way to enable them to do this, perhaps with a field where they can type a number?
Check the module: Custom Global Settings
chandra

Re: Client decides the number of news teasers on the homepag

Post by chandra »

Add an additional content block as the first line to your page template

Code: Select all

 
{content block='newscounter' oneline=true wysiwyg=false label='Number of News' size='3' assign='newscounter'} 


After that modify your news module call like

Code: Select all

{if isset($newscounter) && ! empty($newscounter) && is_int($newscounter)} 
{News number=$newscounter}
{else} 
{News number='3'} 
{/if} 
Last edited by chandra on Sat Aug 02, 2014 6:28 am, edited 2 times in total.
Reclus
Forum Members
Forum Members
Posts: 16
Joined: Fri Dec 01, 2006 11:42 pm

Re: Client decides the number of news teasers on the homepag

Post by Reclus »

Thanks very much chandra, simple solution and works a treat!
User avatar
Rolf
Power Poster
Power Poster
Posts: 7825
Joined: Wed Apr 23, 2008 7:53 am
Contact:

Re: [Solved] Client decides the number of news teasers

Post by Rolf »

You better add a check if the filled in value is a number and not text or something...
- + - + - + - + - + - + -
LATEST TUTORIAL AT CMS CAN BE SIMPLE:
Migrating Company Directory module to LISE
- + - + - + - + - + - + -
Image
chandra

Re: [Solved] Client decides the number of news teasers

Post by chandra »

Nothing is easier like that - example modified ;).
Post Reply

Return to “CMSMS Core”