Is there a way that I made a new category (e.g. old news) in News and after a while (e.g. 1 month) News that are older than 1 month are automatically moved to old news?
Thanks for your anwsers
Bostjan
[SOLVED] Automatically moving old NEWS to archive
[SOLVED] Automatically moving old NEWS to archive
Last edited by bmohor3 on Wed Jun 05, 2013 3:31 pm, edited 1 time in total.
Re: Automatically moving old NEWS to archive
Normally one would use the expiry dates for this.
The newsarticles will stay in their category, but can automatically get inactive after the expiry date has passed.
You may need to change some options in the News admin.
The newsarticles will stay in their category, but can automatically get inactive after the expiry date has passed.
You may need to change some options in the News admin.
Re: Automatically moving old NEWS to archive
Or something like:
News pageArchive page
News page
Code: Select all
{news number='10'}
Code: Select all
{news start='11'}
- + - + - + - + - + - + -
LATEST TUTORIAL AT CMS CAN BE SIMPLE:
Migrating Company Directory module to LISE
Migrating Company Directory module to LISE
- + - + - + - + - + - + -
Re: Automatically moving old NEWS to archive
Or use expiration date and then for archive:
In the template used for archive you could then do some date comparison against $item->enddate and depending on use $item->startdate.
You can do that comparison too to get an automatic archive but I think using an expiration will make the 'current' news query a lot more efficient (more efficient then calling all news items and then in the template compare all startdates agains now() and determine which news items are < 1 month).
Code: Select all
{News showall="1"}
You can do that comparison too to get an automatic archive but I think using an expiration will make the 'current' news query a lot more efficient (more efficient then calling all news items and then in the template compare all startdates agains now() and determine which news items are < 1 month).
Re: Automatically moving old NEWS to archive
Thanks for your tips. Found the solution.
Re: Automatically moving old NEWS to archive
Cool. Please http://forum.cmsmadesimple.org/viewtopi ... =8&t=13968bmohor3 wrote:Thanks for your tips. Found the solution.
- + - + - + - + - + - + -
LATEST TUTORIAL AT CMS CAN BE SIMPLE:
Migrating Company Directory module to LISE
Migrating Company Directory module to LISE
- + - + - + - + - + - + -
Re: Automatically moving old NEWS to archive
How did you implement this?bmohor3 wrote:Thanks for your tips. Found the solution.
Re: Automatically moving old NEWS to archive
I used expiration date as you told me and on first page all the news are shown which dates are not expired yet.velden wrote:How did you implement this?bmohor3 wrote:Thanks for your tips. Found the solution.