Search

Dear All,

I am in the process of creating a section into which news will be posted. However, I want to make sure that users will be able to set a publish date on which the entry will be made available to the public. Similarly I would like to have an expiry date for the events, on which the entries will be hidden to the public.

I could easily set a boolean entry to control publish status, but I'm not sure about how to automate this task. I've been looking around the forums and Google, but I couldn't find any such thing.

Has anyone else implemented such a feature?

Thank you very much for your time :)

http://symphonyextensions.com/extensions/sections_event/

example 5 looks like your thing.

but maybee do something complete different, and using https://github.com/symphonists/datemodified

Thanks for your feedback @moma, however these first extension seems to just enable users to send data from a front-end form to different sections, and the second one is only a field modifier...

What I need is a sort of cron that will check the current date, match it with the expiry/publish date and change the publish flag on the relevant entry, so I don't think these will do for me unfortunately :(

Thanks for your help anyway :)

I've actually found an alternative method, which will not require setting the publish state, but only the publish and expiry dates. Both these fields can then be filtered through Data Source Filters with the keywords earlier than and later than.

Thus, the post will show up if the publish date is later than {$today} AND the expiry date is earlier than {$today}. If the publish date is later than {$today}, but the expiry date is also later than {$today}, then the post will not show up. Same thing, if the publish date is earlier than {$today}, the post will not show up, and whatever is set as expiry date does not matter at that point.

I think this will work well, and the only thing for me to check is how to compare dates, but that's just a side issue (hopefully!).

Hope this can also solve somebody else's eventual dilemmas :)

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details