Forum for discussing general topics related to Couch.
12 posts Page 2 of 2
Not the same but they serve the same purpose.

Two differences -
Couch expects the snippet being embedded to
1. be present within 'couch/snippets' folder (this location is configurable from couch/config.php).
2. contain Couch tags (e.g. <cms:php> instead of <?php)

So, you can make a copy of the head.php and, say, name it head.html and then place it within 'couch/snippets' folder.
Now instead of
Code: Select all
<cms:set seo_title="<cms:editable name='seo_title' type='text' />" />
<cms:php> $title = '<cms:show seo_title />'; </cms:php>
<?php
require('includes/head.php');
?>
you may use -
Code: Select all
<cms:set seo_title="<cms:editable name='seo_title' type='text' />" />
<cms:embed 'head.html' />

To make the snippet properly display the variable, you may modify head.html to make it as follows -
Code: Select all
<!DOCTYPE html>
<html lang="en">
<head>
   <meta charset="utf-8">
   <title><cms:show seo_title /></title>

As you can see, there is no need to invoke PHP for displaying any variable - Couch tags will suffice.

Hope this helps.
Hi

Thanks for your very comprehensive answer and will definitely help with us plugging in the SEO elements needed now.

Cheers
Jonathan
12 posts Page 2 of 2
cron