Forum for discussing general topics related to Couch.
9 posts Page 1 of 1
I had a page working fine with editable regions, but then I tried to create a template in another place on the page, and now none of my text from the editable sections show up. I'm assuming this is because <cms:template> forced my page to be a template, and I'm wondering if I can undo this?
Hi Travis,

Not sure if I understood the question completely but this is what I gathered (please correct me if I am wrong) -
You had a template with editable regions defined like this somewhere in the body
Code: Select all
<div>
<cms:editable name='my_caption' type='text' />
</div>

and then you defined a cms:template tag and moved the editable regions to within that tag e.g.
Code: Select all
<cms:template title='My Template' >
   <cms:editable name='my_caption' type='text' />
</cms:template>

and now the text has disappeared.

That is normal as editable regions defined within cms:template do not output anything - they just get defined.
To show their contents in the main body we'll have to use cms:show tag. So our example now becomes
Code: Select all
<cms:template title='My Template' >
   <cms:editable name='my_caption' type='text' />
</cms:template>

<div>
<cms:show my_caption />
</div>

Does this help?
Yes, that is what happened, but so there's no way to undo the template accident? Like I'll have to do a show for everything now, despite not having the template in there anymore?
Travis,

You can always remove the cms:template tag and revert back to the way things originally were.
It is not that the usage of cms:template tag makes any permanent kind of changes.

If, however (as seems to be happening), you are having trouble in getting things back to their previous state there must be some other reason for that.

If it is ok with you please PM me the problematic template (zip it first - along with the associated snippets if any) and I'll be happy to try to find what might be going wrong.

Thanks
Thank you Travis for sending me the files.

I had a look and I think this is what seems to be happening -
You had a (non-clonable) template 'index.php' and it was using editable regions in the following manner
Code: Select all
<div class="welcome-wagon max-width">
   <cms:editable name='welcome_wagon' type='richtext'></cms:editable>
   <cms:editable name='sub_welcome_wagon' label="Sub Title" type='richtext'></cms:editable>
</div>

Then later on you decided to add a listing of portfolio to index.php so you added the following to it -
Code: Select all
<section id="our-work">
   <cms:embed 'portfolio_list.html'/>
</section>

The embedded 'portfolio_list.html' snippet, and herein lies the glitch, contains the following
Code: Select all
<cms:template title="What We Do Section" clonable="1" commentable="0">
   <cms:editable name="slide_background" type="image" />
   <cms:editable name="slide_content" type="richtext" />
</cms:template>

The snippet above now effectively declares the 'index.php' template (i.e. the one in which the snippet is contained) as clonable.

I won't get into the details of it as that is explained in depth in the docs (http://www.couchcms.com/docs/concepts/cloned-pages.html). The point here is that your code now runs in list-view and hence does not show any data.

More importantly, this is not what you had intended.
You don't want to create cloned pages out of index.php. You want to do that with portfolio items (as those are the ones that are going to me more than one).

We'll come to creating the portfolio items latter. First let us get index.php back to its original non-cloned state.
To that we simply need to remove the cms:template tag block. Since you are adding that via an embeddable snippet, remove the call to the snippet i.e. the following statement from index.php
Code: Select all
<cms:embed 'portfolio_list.html'/>

Access index.php as super-admin for the change to take effect. Now coming back to admin-panel, you should see index.php get back to its original state.

Please try the above and let me know.
We'll discuss the portfolio part after that.

Thanks.
Yes, that worked, thanks. I guess I'm pretty confused about portfolios. I'll finish that tutorial. Thanks for the help.
I am glad it worked :)

Coming back to listing portfolio items - we have two options (choose whichever suits you)
1. Create a separate template named 'portfolio.php'. Declare it as 'clonable' by placing the following in it
Code: Select all
<cms:template title="What We Do Section" clonable="1" commentable="0">
   <cms:editable name="slide_background" type="image" />
   <cms:editable name="slide_content" type="richtext" />
</cms:template>

Now create a cloned page each for every portfolio item.

To display the items on your index.php, use the following (rough outline)
Code: Select all
<cms:pages masterpage='portfolio.php' >
   <cms:show slide_background />
   <cms:show slide_content />
</cms:pages>


2. As an alternative, instead of using a second template for portfolio items, if the items are not too many use 'repeatable regions'. You can find the docs here - http://www.couchcms.com/docs/concepts/r ... gions.html

Do let us know if you require any help.

Thanks
Thanks so much for the help! Do you know of any irc channels that I might be able to ask stupid questions in about this CMS? I tried freenode's #CMS, but it was only for one, specific CMS, not cms's in general.
There are no stupid questions, Travis :)
Please feel free to post any question that bothers you right here on this forum.

Thanks.
9 posts Page 1 of 1