Forum for discussing general topics related to Couch.
2 posts Page 1 of 1
Hi,
I use php includes to include headers and footers, i have a blog_list in couch/snippets dir that also uses the same includes but they are not working
i dont really want to move the header and footer to the snippets dir and embed them as it would mean editing a large number of files.

I am sure i read somewhere on these forums, but cannot find it now that we can put something before and/or after the phop includes so it would work ok?

If so can someone please refresh my memory

Thanks
Hi,

Within the Couch snippets, the native PHP code (i.e. that enclosed within <?php ... ?>) no longer work.
One needs to change the <?php ... ?> tags to <cms:php> ... </cms:php> for Couch to recognize and pass the enclosed code to PHP for execution.

So, for example, if your snippet contains the following -
Code: Select all
<?php require('includes/head.php'); ?>

You can modify the line to become -
Code: Select all
<cms:php> require('includes/head.php'); </cms:php>


That said, using PHP from within Couch is rarely straightforward and will require some understanding of how the two interact to rectify ensuing problems. You can find several threads on the forum discussing this topic.

Hope this helps.
2 posts Page 1 of 1