Problems, need help? Have a tip or advice? Post it here.
3 posts Page 1 of 1
I have a website which is organised in such a way in folders:
www.mysite.com/about/
www.mysite.com/blog/
www.mysite.com/contact/

In each folder is a index.php file. I would like to keep this neat folder structure but retrofit Couch. Can this be done?
Hi and welcome, profilesis.

In each folder is a index.php file. I would like to keep this neat folder structure but retrofit Couch. Can this be done?

Yes, of course.
As per usual, place the 'couch' folder in the root and register the index files you mentioned as templates.
http://www.mysite.com/about/index.php
http://www.mysite.com/blog/index.php
http://www.mysite.com/contact/index.php

Just two things to keep in mind though -
1. since now the templates are inside a folder, instead of the usual first PHP statement i.e.
Code: Select all
<?php require_once( 'couch/cms.php' ); ?>

use the following instead
Code: Select all
<?php require_once( '../couch/cms.php' ); ?>

2. The names of these templates, as understood by Couch (e.g. the 'masterpage' parameter of cms:pages tag) will now have the folder too e.g.
'about/index.php' instead of just 'index.php'.

Hope this helps.
Thanks! The only thing I hadn't done was 'register' the files by accessing them in the browser - I must have missed that in the docs.

Cheers! M.
3 posts Page 1 of 1