Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

General Questions

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

update a page through query


Reply

3 Posts   1005 Views

Avatar
blaise4714

24 January 2010 at 10:31am Community Member, 10 Posts

Hello Everybody,
I am building a website with silverstripe and i need some directives. A page of my website should be daily update with new information (content). For this i build a table in my Mysql database. In this Table there are 2 columns: data and the validdate.
is it possible in silverstripe to automatically update the page content at the specified date through Query on my database? How?
Thank you in advance

Avatar
zenmonkey

25 January 2010 at 3:54am Community Member, 528 Posts

There is an embargo/expiry module that allows for time based publishing of content, but I've heard rumours its being discontinued and I haven't actually be able to get it to work.

But if the publishing date already exists as a date field on your data object its just a matter of wrapping the relevant part of your template with a <% if Validate.InPast %> <% end_if %> (assuming the Validate column is your Date field ). http://doc.silverstripe.org/doku.php?id=date

Avatar
blaise4714

25 January 2010 at 6:56am Community Member, 10 Posts

thanks, i tried to download the module embargo, it seems that the link is down. However i dont know if this module is the quite solution of my problem, because i dont want that the page expires. Only the content of page will be update daily. in others words, when a user open the page, the valid information will be displayed, this information should come from a query on the existing database.
Thank you for all answers.