Forum for discussing general topics related to Couch.
2 posts Page 1 of 1
HI,

I'm trying to take the value from a template and inject it into a PHP function.
I can use this fine in something like a standard H1 tag, but cannot work out how to send this to PHP.

Can someone help me work out how to do this please?

Code: Select all
<cms:template title='News and Updates'>
    <cms:editable name="title" label="Page Title" type="text"/>
</cms:template>

<h1><cms:show title/></h1>

<?php SetPageTitle("News and Updates"); ?>
Hi,

Please see -
https://docs.couchcms.com/tags-reference/php.html

Applying that to your specific use-case, you could use the following -
Code: Select all
<cms:php> SetPageTitle("<cms:show title/>"); </cms:php>

That said, interaction between native PHP and Couch code, though definitely possible, often requires some amount of care.
There are several posts on this topic and if you happen to require any further help feel free to let us know.
2 posts Page 1 of 1