Problems, need help? Have a tip or advice? Post it here.
5 posts Page 1 of 1
Hi guys, firstly isnt couch CMS awesome! Im trying to push my skills in this system and ive run up to a bit of a wall and need a prod in the right direction (or even better - the answer :P )

Im trying to utilise the clonable aspect of templates to allow my client to add, delete, edit and publish their own pages, now firstly is this possible?

If so, how? Ive set up my master html template, that id like to clone and reuse so im guessing the usual code of:
Code: Select all
<cms:template title="Webpages" clonable="1">

</cms:template>
applies?

Within this, ive defined the editable regions, ie, keywords, description, side bar, main content etc etc, however im having trouble ensuring the pages get output in this format:

Code: Select all
http://www.domain.com/created-page.php / this includes index.php
etc

Is this functionality possible, I do not want to have this kind of url

Code: Select all
http://www.domain.com/page-template-name/page-name.php


Hopefully ive explained myself correctly, if not shoot me a questions and ill be happy to clear up my requirements.

Thanks in advance for the help.
It's possible. You might want to look at using nested pages, but you can do what you want with cloned pages, you just need to turn dynamic folders on.

Code: Select all
<cms:template title="Webpages" clonable="1" dynamic_folders='1'>

</cms:template>


A big thing to remember with this CMS that has helped me use it better is that you can actually keep your PHP template totally separate from the actual HTML by simply embedding the html into the template using the <cms:embed /> tag - the HTML is then stored in the snippets folder. You then simply use the <cms:show /> tag to actually insert content from the editable template areas you created into the HTML document - no need for the PHP header and footer tags, your embedding the html into a document containing them. You could have all of this in one document if you wanted as well. That might be what's confusing you, it certainly tripped me up for a while, especially given that cloned pages have a few ways you could be viewing them.

http://www.couchcms.com/docs/concepts/views.html

I don't know if you can get around having the template name show up in the URL if you want dynamic pages. I know other CMS systems like squarespace can get around that. You'd have to find a way to Clone the entire template and give it a new name from what I understand. I don't think you can do that yet in the Admin panel, especially since it would mess up pretty URL's if you've already turned it on.
Thanks for your reply, that html snippets thing does look incredibly useful, ill most certainly be taking a look at that, thanks for the tip!

Going back to this though for the second, ive edited the code as you have suggested, and when viewing from the back end I get this url (as an example)

Code: Select all
http://www.blahblah.com/index.php?p=12


Little ugly, so I nip over to the config file, change
Code: Select all
define( 'K_PRETTY_URLS', 0); To define( 'K_PRETTY_URLS', 1);


Now a much better URL is being output, exactly what im looking for:
Code: Select all
http://www.blahblah.com/customer-service.html


but the browser is reporting an error that the file cannot be found, note that all my code for these repeatable pages is contained in index.php. First few lines:

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

<cms:template title="Webpages" clonable="1" dynamic_folders='1' order="1">
   
    <cms:editable name='seo' label='Search Engine Optimisation' desc='Page SEO' type='group' />

    <cms:editable
         name='keywords'
         label='Keywords'
         desc='Enter page keywords'
         type='text'
         group='seo'
         />

    <cms:editable
        name='pageDescription'
        label='Page Description'
        desc='Enter page description'
        group='seo'
    />

</cms:template>

<!doctype html>


any ideas where im screwing up here? Thanks for the help so far! Im a step closer!

Update: just thinking about this again, could problems be created because one of the pages I need to create and manage this way is the index page itself? Would I be better off having this as a normal stand alone page even though it shares the same standard markup as the other pages?
Post the error code. I'm guessing you probably forgot to rebuild the .htaccess file and upload it to the server. Also, only turn the pretty URL feature on when you are done building the site. If you ever make changes like adding a template, you have to rebuild .htaccess and re-upload it.

I believe each template needs to be it's own php file, so that might be a problem if all of them are in one file.
@l1ca, I'll agree with @cardmaverick - the 404 error is due to the stale .htaccess.
As suggested by him, you'll be better off turning prettyURLs on (and generating the .htaccess file) once the site is complete (or atleast all the required templates are registered).

Using prettyURLs with 'index.php' is not a problem at all.
I suggest you please take a look at the following for an overview of how the URLs will show up -
http://www.couchcms.com/docs/concepts/pretty-urls.html

Let us know if you need any clarifications.

Thanks.
5 posts Page 1 of 1
cron