Hey there, Couch-people
I am currently trying to somehow store the current year in a variable that i can re-use for a <cms:if> condition, to display an "active" attribute in an anchor tag.
I tried creating a global value using the cms:php tag, but i can't seem to use it in the if condition.. Is there any suggested best practise?
This is what i tried:
I am not a PHP expert, so i am sure i am missing something here - a less clumsy approach would also be greatly appreciated!
Thanks in advance!
Kind regards
Sundance

I am currently trying to somehow store the current year in a variable that i can re-use for a <cms:if> condition, to display an "active" attribute in an anchor tag.
I tried creating a global value using the cms:php tag, but i can't seem to use it in the if condition.. Is there any suggested best practise?
This is what i tried:
- Code: Select all
<cms:editable
name='year'
label='Year'
desc='enter year'
type='text' />
<cms:php>
global $curyear;
$curyear = echo date('Y');
</cms:php>
<cms:if year = curyear >
class="active"
</cms:if>
I am not a PHP expert, so i am sure i am missing something here - a less clumsy approach would also be greatly appreciated!

Thanks in advance!
Kind regards
Sundance