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

I am very pleased with CouchCMS, its basically fantastic for us HTML/CSS only designers. However, as I am building my first blog/news part with Couch, I ran into some trouble (I have no prior knowledge of PHP coding FYI).

I have a starting page, "index.php", that contains first of all some text and images welcoming the visitor, and underneath it displays the latest news. Listing all the news posts after the welcome text hasn't been a problem, until I wanted the text part to be editable in Couch. My index page has the "clonable='1'" attribute, and also has the template name "Add news". Adding news works fine. To make things look decent, I needed to but the welcome text and all the images in my list_news.php file, since I do not want them to show if only a single news post is being shown. However, when I try to make the welcome text editable with cms:editable, it just disappears, or I get an error saying that the page is clonable.

Where should I put the different parts of code for it to work out?
Thanks alot 8-)
Hello and welcome Oggelito :)
I am glad you found Couch useful.

From what I could gather from your post, you are using only a single template (index.php) that has been cloned to create the news items as well.

I would have approached it by using two templates -
index.php (uncloned) - Define editable regions that appear on your home page above the listing you mentioned.
news.php (cloned) - Define editable regions pertaining to news. Create individual news items from this.

The listing of the news items can still be done on your 'index.php' simply by using the 'masterpage' parameter e.g.
<cms:pages masterpage='news.php' limit='5'>
...
</cms:pages>

Hope this helps. Do let us know if something is unclear.
Wow, that was a fast reply! Thanks alot. I see what you mean and I think I understand. The setup I have now is:

index.php with:
Code: Select all
<cms:template title='Frontpage' />

and
Code: Select all
<cms:pages masterpage='news.php' limit='3'>
</cms:pages>


news.php with:
Code: Select all
<cms:template title='Add news' clonable='1'>
<cms:editable name='news_content' type='richtext' />
</cms:template>
<cms:if k_is_page >
[i]...HTML stuff...[/i]
<cms:else />
<cms:embed 'list_news.php' />
</cms:if>


list_news.php with:
Code: Select all
<cms:pages masterpage='news.php' >
<h5>» <a href="<cms:show k_page_link />"><cms:show k_page_title /></a></h5>
<p><cms:show news_content />
</p>
</cms:pages>


What am I doing wrong? :oops:
It feels like im screwing something with the masterpages... When I try to access index.php I get "ERROR: Tag: template Cannot make template non-clonable. Cloned pages exist.". Too bad you made a PHP CMS for designers... now you get all these stupid questions ;)
Hi,

The 'index.php' was previously declared as clonable and had several pages too.
Couch is simply complaining that if we make the template non-clonable, the pages will get orphaned.

Please first delete all the cloned pages of index.php and then access it for the change (uncloned from cloned) to take effect.

Do let me know how you fare.
KK wrote: Please first delete all the cloned pages of index.php and then access it for the change (uncloned from cloned) to take effect.


Aaahh, there is no better feeling than when things just start working. Like a charm! Thank you, sir, very much, for amazing (and unbelievably fast) help. I am already recommending this to all my friends and I will be a paying customer myself soon (so you might hear from me in this forum again ;) )
Best regards
5 posts Page 1 of 1