Problems, need help? Have a tip or advice? Post it here.
3 posts Page 1 of 1
Hi,

I tend to set a variable on a page by page basis i.e. $body_class = 'home';

I use this to style elements on each page differently.

What is the best/preferred way to echo this variable when using a Couch template?
- Dan
Hi,

The preferred way is to use Couch variables - you don't really need to use PHP for what you are trying to do.
However, if you must then following is how you could echo it in Couch templates -
Code: Select all
<cms:php>global $body_class; echo $body_class;</cms:php>


Hope this helps.
Hello,

Thanks for replying!

If I don't necessarily need to use PHP to achieve what I am trying to do, what would you suggest?
- Dan
3 posts Page 1 of 1