Schedule content plugin visualization?

26 views
Skip to first unread message

pietro conconi

unread,
Feb 2, 2015, 11:46:35 AM2/2/15
to django-cms...@googlegroups.com
Hi,
I'd like to schedule the publication (for the end-user) of the content of a specific plugin.
The only way to do this, is to add to my-plugin two fields (date_from, date_to) and,in the render method, check the date?
It is correct?
Is there another path to achieve the same result?

Thank's.
Pietro.

Benjamin Wohlwend

unread,
Feb 2, 2015, 12:11:36 PM2/2/15
to Django Cms Developers
Hi Pietro,

please use the "django-cms" mailing list for questions about developing with django CMS. This list is about development of django CMS itself.

As for your question, I think this would be a great use case for nested plugins. Create a "ScheduledPublicationPlugin" with "date_from" and "date_to", which accepts any plugins as child plugin, but only renders them when the current date/time falls within the two dates, or if you are in edit mode (so you are able to edit the plugins before they are visible publicly). This way, you can schedule any kind of plugin for publication.

See http://docs.django-cms.org/en/3.0.9/how_to/custom_plugins.html#nested-plugins for more information.

Cheers,
Beni

--
You received this message because you are subscribed to the Google Groups "django CMS developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-cms-devel...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages