-
News / Archive
I need to make the news page as:
- show the actual news
- if a news is older than 6 month it should go to the archive
- the archive should be shown per year
My question is if is there a possibility for my second point (to put automatically in the archive after six month)? Or is there any other possible workover in contao for this?
Thanks!
-
Update:
Maybe it's more logical (easier to understand) to show only the last six month's news, and the other in the archive. But how could I do this? :)
-
Could be a solution?
Ok, it seems there is no good solution for this. I was thinking to use categories and cronjob. Set up a monthly task, which checks the date of every news which is not in the 'Archive' category, and if it's 6 month old, than add the post to the `Archive` category. For me it seems this is not a bad solution, but I am still open for a better one. If there isn't any, than any help with this would be awesome, because I don't really have any ideas (yet) how to add a category for a post from code. I'm using the `news_categories` extension.
-
Last post here
Ok, the faster, the better. Only one last question: if I change files in "/system/modules/news/models...", would be this overwritten with the next core update? If yes, what would be a solution if I want to change minor things in the news model?
-
Yes this would not be update safe. You can write an own extension which extends the news extension. But maybe you can simply filter the desired news within the template.