Is there anyway of allowing content to display on a mentioned day- so if it was monday- the content will only display on every monday and won't display every other days content.
We've moved the forum!
Please use forum.silverstripe.org for any new questions
(announcement).
The forum archive will stick around, but will be read only.
You can also use our Slack channel
or StackOverflow to ask for help.
Check out our community overview for more options to contribute.
I take it the advanced workflow with embargo and expiry dates did nothing for you...
how about this then...
in your page controller...
public function Content() {
$content = $this->getField('Content');
if (date('N')==1) { //if Monday
$content = 'It is Monday you get this string instead';
}
return $content;
}
Wow!! Thanks:)
I can't get alot of PHP coding right! Lol
Though, I think that this post definitely helped for the code inside the php, does anybody know how to make it so that it can display content that you can edit in the cms?
Any help would be greatly appreciated.
-Hibari
All you'd have to do is replace
$content = 'It is Monday you get this string instead';
with
$content = $this->getField('MondayContent');
And obviously add the MondayContent field to the page object
and I had pointed yer man to http://silverstripe.org/advanced-workflow-module/ this before which has options for controlling (with embargo / expiry) when certain pages can be seen.