Problems, need help? Have a tip or advice? Post it here.
5 posts Page 1 of 1
Hi guys,

I'm learning couch and currently going through the Aurelius tutorial and in particular stuck on the creating a clone template.

I have placed the following code at the top of the blog.php document:

<?php require_once( 'couch/cms.php' ); ?>
<cms:template title='Blog' clonable='1' commentable='1'>
<cms:editable name='blog_content' type='richtext' />

<cms:editable name='blog_image'
crop='1'
width='610'
height='150'
type='image'
/>
</cms:template>

I then placed the closing php tag at the end of the document, after the closing html tag:

<?php COUCH::invoke(); ?>

Then I placed the cms strings into the correct places within the body of the html as follows:

<!-- Post Title -->
<img class="thumb" src="<cms:show blog_image />" alt=""/>
<!-- Post Content -->
<cms:show blog_content />
<!-- Post Links -->

I've typed in some text to the blog_content richtext field in the admin panel and uploaded an image of the right size. I click 'save' then 'veiw' and the page displayed looks fine. However when I go to look at the actual page in the browser the edited data does not show. I'm pulling my hair out here since I just don't know what I'm doing wrong.

I've attached two screenshots; one is the preview I get when clicking 'view' in the admin panel after making my edits, the other is the actual blog.php page viewed in the browser, and you can clearly see the edited elements don't show in the latter.

I'd really appreciate some help here.

Thanks in advance

Marc

Attachments

If I am understanding you correctly, the two pages you are viewing are:
yoursite.com/blog.php
yoursite.com/blog.php?p=# (where # is the number of your cloned page)

Is this correct? Is this site accessible on the internet? Even though this should not be an issue, just to rule things out please disable caching in your config.php file.
Hi cheesyproof

No the site isnt live I'm doing this through a localhost.

This is the preview page that shows the image and my test post:

http://localhost:8080/blog.php?p=2

This is the actual page that doesn't show the image and post:

http://localhost:8080/blog.php

I don't think it's a caching issue, I've been using FF but I've just checked it in Chrome as well and the info still isn't showing.

Thanks,

Marc
Your code does not appear to account for the list-view(s). When viewing a blog post (blog.php?p=2) the editable region content is available. However, when viewing the blog list (blog.php) the content is not directly available and must be accessed inside of a cms:pages tag.

The problem you are encountering is addressed in the tutorial: http://www.couchcms.com/docs/tutorials/portfolio-site/blog.html - 2/3 of the way down (Using the conditionals) and into http://www.couchcms.com/docs/tutorials/portfolio-site/blog-2.html.
Thanks cheesyproof, that was a great help! :-)

Kind regards,

Marc
5 posts Page 1 of 1
cron