I have field for uploading image. Sometimes i get this message and sometimes is working?
Tnx for help
http://i.imgur.com/PDhyCGv.png
Tnx for help

http://i.imgur.com/PDhyCGv.png
KK wrote: Please move the definition of the field within a cms:template block placed right at the top of your main template (and not in any snippet, for example).
Does this help?
If not please PM me your template and I'll take a look at the code.
Thanks.
KK wrote: Problem seems to be that the snippet (and hence the editable region's definition contained within it) is executed conditionally - i.e. depending upon whatever logic you've coded, sometimes it executes and sometimes it does not. When it does not, Couch thinks you've removed the definition.
That is why I asked you to place the definition at the very top of the template where we can be sure that the definition gets executed every time the template is run.
It'll make no difference to your code. You can move the definition to within cms:template block and them use <cms:show name_of_region /> where it is currently located. It'll work just the same.
Sure. Please PM me the template and the relevant snippets.Do you wanna take look?
<?php require_once( 'couch/cms.php' ); ?>
<cms:template title='Vijest' clonable='1'></cms:template>
<cms:editable name='vijesti_velike' type='richtext' hidden='1' label='Vijesti' />
<cms:if k_is_page>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
..
..
<cms:else/>
<cms:embed 'index.html'/>
</cms:if>
<?php COUCH::invoke(); ?>
<cms:editable name='prva_slika' type='image' label='Slika' />
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
..
..
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<?php require_once( 'couch/cms.php' ); ?>
<cms:template title='Vijest' clonable='1'>
<cms:editable name='vijesti_velike' type='richtext' hidden='1' label='Vijesti' />
<cms:editable name='prva_slika' type='image' label='Slika' />
</cms:template>
<cms:if k_is_page>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
..
..
<cms:else/>
<cms:embed 'index.html'/>
</cms:if>
<?php COUCH::invoke(); ?>
KK wrote: Thanks. I had a look and as I suspected you have defined the editable region in a snippet (handling 'list-view').
As I suggested before, the editable region should be moved to the *main* template which, in your case, is 'index.php'.
To make it clearer allow me to spell out the exact steps.
There are two files involved -
a. index.php (this is your main template that shows up in the admin sidebar)
b. index.html (this resides in 'snippet' folder and handles the list-view of the main template above).
The current code you have in 'index.php' is (truncated)
- Code: Select all
<?php require_once( 'couch/cms.php' ); ?>
<cms:template title='Vijest' clonable='1'></cms:template>
<cms:editable name='vijesti_velike' type='richtext' hidden='1' label='Vijesti' />
<cms:if k_is_page>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
..
..
<cms:else/>
<cms:embed 'index.html'/>
</cms:if>
<?php COUCH::invoke(); ?>
and the current code in the snippet 'index.html' is (truncated)
- Code: Select all
<cms:editable name='prva_slika' type='image' label='Slika' />
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
..
..
Please remove the editable region definition from index.html to make it -
- Code: Select all
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
- and make the code in index.php as follows -
- Code: Select all
<?php require_once( 'couch/cms.php' ); ?>
<cms:template title='Vijest' clonable='1'>
<cms:editable name='vijesti_velike' type='richtext' hidden='1' label='Vijesti' />
<cms:editable name='prva_slika' type='image' label='Slika' />
</cms:template>
<cms:if k_is_page>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
..
..
<cms:else/>
<cms:embed 'index.html'/>
</cms:if>
<?php COUCH::invoke(); ?>
As you can see, I've moved both your editable regions into the cms:template block that is present at the very beginning of the main template i.e. index.php.
Hope this helps.
I think so. Please try and let us know.And this will be fine?
KK wrote:I think so. Please try and let us know.And this will be fine?