[[*eventDate:gt=`[[!dateToday]]`:then=`[[$regButton]]`:else=``]]
[[!If? &subject=`[[+dateToday]]` &operator=`<` &operand=`[[*eventDate]]` &then=`[[$regButton]]` &else=`` ]]
This question has been answered by BobRay. See the first response.
<?php
if(time() < $eventDate){
return $modx->getChunk('regButton');
}
return "";if(time() < strtotime($eventDate)){Do it in a snippet. There you can interrogate the current date, then return the chunk if the $eventDate has not passed, otherwise return nothing.
<!--?php if(time() < $eventDate){ return $modx--->getChunk('regButton'); } return "";
[[registrationButton]]
%A, %B %d, %Y
[[registrationButton? &eventDate=`[[*eventDate]] ]]
$eventDate = $modx->getOption('eventDate', $scriptProperties);%A, %B %e, %Y
<a href="[[~27]]"><div class="button round">Register today!</div></a>
<?php
$eventDate = $modx->getOption('eventDate', $scriptProperties);
if(time() < strtotime($eventDate)){
return $modx->getChunk('regButton');
}
return "";[[!registrationButton? &eventDate=`[[*eventDate]]` ]]
I'm glad you got it sorted. Thanks for reporting back.