Forum for discussing general topics related to Couch.
3 posts Page 1 of 1
Hello,
my globals.php has an editable region

Code: Select all
<cms:editable name='news_titel' type='text' label='News' >Text</cms:editable>


Instead of printing this on a template, I want to have a variable I can work with.

<cms:get_custom_field 'news_titel' masterpage='globals.php' />
prints the title directly on my page.

Is it possible to store news_titel as a variable in my template to work with conditions instead of printing the title directly on my page.

I start with this to find out more, ... viewtopic.php?f=2&t=7349
* * * * * * I LOVE COUCH CMS - flexible and straight forward * * * * * *
Hi chichi,

Is it possible to store news_titel as a variable in my template to work with conditions
Yes, of course. This was actually shown in the thread you mentioned -
Code: Select all
<cms:set my_var="<cms:get_custom_field 'news_titel' masterpage='globals.php' />" />

With the code above, the variable named 'my_var' now contains the data from the global region.
You can use it like any other variable in Couch e.g.
<cms:if my_var >..</cms:if>
<cms:show my_var />

Hope it helps.
I got it with <cms:set variable ...from global ...
works! Thank you so much!
* * * * * * I LOVE COUCH CMS - flexible and straight forward * * * * * *
3 posts Page 1 of 1
cron