21288 Posts in 5733 Topics by 2602 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 500 Views |
-
Content displaying on certain mentioned day

5 May 2011 at 7:30pm
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.
-
Re: Content displaying on certain mentioned day

5 May 2011 at 8:15pm
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;
} -
Re: Content displaying on certain mentioned day

5 May 2011 at 10:13pm
Wow!! Thanks:)
I can't get alot of PHP coding right! Lol -
Re: Content displaying on certain mentioned day

12 July 2011 at 1:20pm Last edited: 12 July 2011 1:23pm
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
-
Re: Content displaying on certain mentioned day

15 July 2011 at 2:34am
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
-
Re: Content displaying on certain mentioned day

15 July 2011 at 2:41am
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.
| 500 Views | ||
|
Page:
1
|
Go to Top |




