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

i am using CouchCMS. when i am using front end edit option in my .php file then display two time same name that i added.

my php file code is below:

<cms:editable name='main_title' label='Title' type='text'></cms:editable>
<h4 class="page_title"><cms:show main_title/></h4>
<cms:popup_edit 'main_title' link_text='Edit title' />



When i enter Title: Over Story then it's display two time. that can show in attachment image.

i want to display this title only one time.

So please know me solutions if any one know that.

Thanks.

Attachments

Please try using the following:

Code: Select all
<h4 class="page_title" <cms:popup_edit 'main_title' link_text='Edit title' /> ><cms:show main_title/></h4>
Image
where innovation meets technology
Hello and welcome, Ketan :)

The first output that you see is from the <cms:editable> tag itself. The second, of course, is from the <cms:show>.

If you wish to define the editable region in-line (i.e. use the output of an editable region right where it is defined), you can change the following line
Code: Select all
<h4 class="page_title"><cms:show main_title/></h4>
to -
Code: Select all
<h4 class="page_title"><cms:editable name='main_title' label='Title' type='text'></cms:editable></h4>

If, however, you wish to define the editable region at one place and use its value at some other place(s), there are two choices -
1. Instruct the editable region not to output its contents by using the 'hidden' param -
Code: Select all
<cms:editable name='main_title' label='Title' type='text' hidden='1'></cms:editable>

2. or, and this is the recommended procedure, define all editable region at a single place (usually at the beginning of the template) within the cms:template block e.g. like this -
Code: Select all
<cms:template>
    <cms:editable name='main_title' label='Title' type='text'></cms:editable>
    .. other regions also defined here ..
</cms:template>

You can now output the contents of the region using cms:show
Code: Select all
<h4 class="page_title"><cms:show main_title/></h4>

Hope it helps.
3 posts Page 1 of 1