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

Here's the scenario. I am uploading multiple images with the gallery option.

Within these gallery pages, I give a multiple choice of format in the back-end with the option to select one in a drop-down as follow:

Code: Select all
<cms:editable name="style" label="Choose a type" desc="Regular, Regular square, Regular rectangle, Original square, Original rectangle"
  opt_values='Regular=0 | Regular square=1 | Regulare rectangle=2 | Original square=3 | Original rectangle=4 '
  opt_selected = '0'
  type='dropdown'
  order='14'
/>


The problem is that opt_selected show the drop-down with the selected option but it is not saved yet.
I actually have to visit all the pages one by one and save them to make the selection appearing in the front-end.

My question is: is it possible to have the value selected by default saved as actual value for the front-end upon uploading the images without visiting the page and saving it?

Thanks for any help.
Paolo
I suggest you stage an experiment with tag <cms:persist> inside <cms:config_form_view> and let us know the result. I know this tag works well on page save, and suspect it probably might get triggered on page creation as well.
@PaoloE, if a template has existing cloned pages and a new field is added afterwards, the existing pages won't automatically get the value of the new field - this happens when a page is saved (which is what you are experiencing).

One workaround would be to add a conditional in your frontend code to cover this case e.g.
Code: Select all
<cms:if style = ''><cms:set style='0' /></cms:if>

where we explicitly set the default value where a variable appears to be empty.

Hope this helps.
KK wrote: we explicitly set the default value where a variable appears to be empty.

Seems to be the best solution.
4 posts Page 1 of 1
cron