Problems, need help? Have a tip or advice? Post it here.
3 posts Page 1 of 1
Hi,
Ive had a look at the examples for the sample portfolio site. I decided to download and use the blog section. I'm using couch in the following directory structure:

/couch <--- Couch Dir
/cms <--- Template Files


Therefore I had to change a few things for example embed files and the main include:

From
Code: Select all
<?php require_once( 'couch/cms.php' ); ?>

To
Code: Select all
<?php require_once( '../couch/cms.php' ); ?>


From
Code: Select all
<cms:embed 'blog_sidebar.html' />

To
Code: Select all
<cms:embed '../../cms/blog_sidebar.html' />


Now masterpage does not seem to work. Removing them helps get most features working because it falls back to the current page but on the links it does not. See below:

Code: Select all
<a href="<cms:link masterpage='blog.php' />" class="button float" >&lt;&lt; Back to Blog</a>


My question is what path should be supplied to masterpage?
Cheers Jason.
Hi,

Couch names the templates relative to the folder that is the parent of the 'couch' folder.
Usually this is the root folder of a site.
So if 'blog.php' was located in the site's root folder, its 'masterpage' attribute would be simply 'blog.php'.
If 'blog.php' was located within a sub-folder of the root named 'cms', the 'masterpage' attribute will become 'cms/blog.php'.
If 'blog.php' was to be placed within yet another folder nested within 'cms' e.g. 'my', it would become 'cms/my/blog.php'.

Hope this answers the question.

By the way, if you do not mind my asking it, why exactly are you placing ALL the templates within the 'cms' folder?
Doing this will make you access them with a 'cms' in the URL e.g. http://www.yoursite.com/cms/blog.php
If that is all you wish to have, a better approach would be to place the 'couch' folder within the 'cms' folder as well-
Code: Select all
root
--cms
----couch
----blog.php
----about-us.php

As mentioned previously Couch names the templates relative to the folder that is the parent of the 'couch' folder - for the folder structure above, the parent folder of Couch would be 'cms'. So now the 'masterpage' attribute for the templates will simply be 'blog.php', 'about-us.php' etc.
This will be much easier to work with instead of the manipulation to the paths required in the method you are using.
Cheers for the detailed reply, I've decided to move the couch folder. The reason I'm using the cms folder is that integrating couch cms into x-cart e-commerce platform. See x-cart has a static page system used for extra pages that are not standard to the shop but if you require a blog and in this case I need team pages (profile of each person who runs the shop) its not possible so I thought it would be interesting trying to use a another cms but still maintain the shop header, nav bar and footer on each page without having to hard code any links.

It works a treat, my first solution is using iframes that auto resize to the content.
Cheers, Jason.
3 posts Page 1 of 1

Who is online

In total there are 16 users online :: 0 registered, 0 hidden and 16 guests
(based on users active over the past 5 minutes)

Users browsing this forum: No registered users and 16 guests

cron