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

When creating a dropdown list that is dynamically populated from a snippet, it seems that the 'dynamic' parameter doesn't work inside a repeatable region.

Code: Select all
    <cms:editable 
      name="category"
      label="Choose Category"
      opt_values='categories.html'
      dynamic='opt_values'
      type='dropdown'
   />


I'm trying to use a repeatable region to upload portfolio items, assigning each to a category using the above code.

The code works fine if placed outside of
Code: Select all
<cms:repeatable name='portfolio' ></cms:repeatable>
, but doesn't work inside. Instead, the word 'categories.html' appears in the dropdown.

This is quite a big issue for me. The client has the ability to define the categories elsewhere in Couch, so I need a way for them to be able to use the categories in this manner.

Any thoughts?

Lewis
Hey Lewis,

That 'dynamic' parameter is really an 'undocumented' one - I am sorry but I don't think it'll work with the repeatable regions.

As a fall-back, we can use the following method (not fully dynamic but better than hard-coding the options):
<cms:editable
name="category"
label="Choose Category"
opt_values="<cms:embed 'categories.html' />"
type='dropdown'
/>

In the snippet above, we set the opt_values by using an embedded script that outputs the drop-down's values.

This method is not fully dynamic in the sense that when your client modifies the categories, the drop-downs won't automatically reflect the new values - he'll have to visit the template containing the drop-down' definition shown above as super-admin, which will then modify the dropdown.

Not as clean as the 'dynamic' parameter but this is all we can do for now.
Why have this as an 'undocumented' feature?

Having these powerful options is what sets Couch apart from the rest. You should be shouting from the rooftops, not hiding features away :)

With this particular issue, I ended up hard-coding the dropdown. Your alternative solution is appreciated, but wasn't ideal for this particular client who isn't very technical.

Lewis
3 posts Page 1 of 1