Problems, need help? Have a tip or advice? Post it here.
6 posts Page 1 of 1
Hi everybody !
This is my first post on this forum (but not my last!).

I need to create this :

On my front office this will appear :

Galerie
Texte
Galerie
Texte
Galerie

On my back office, for each area I'm using the the 'group' type editable region.

So for each area, at the top I want an dropdown menu (Display : Yes | No)

Any idea how I can do it ?

Thank you !

*** If you don't know: Learn. If you know: Share. ***
*** If you don't know: Learn. If you know: Share. ***
Hello and welcome.

If I understood you right, you need the yes/no dropdown to control which group to display on the front-end and this dropdown needs to be just above the group (and not within it) in the admin-panel. Am I right?

If so, you can use editable regions of type 'dropdown' to create the yes/no list and then use the 'order' parameter to put the dropdown immediately above the 'group' (that has an 'order' parameter placing it below the dropdown)
Code: Select all
<cms:editable 
  name="show_group_1"
  label="Show this group?"
  opt_values='Yes | No'
  opt_selected = 'Yes'
  type='dropdown'
  order='1'
/>

<cms:editable name='group_1' label='Group 1' type='group' order='2' />
.. editable regions belonging the group above here ..

Of course if I understood the question wrong, please let me know.
Thanks.
A picture is always better than a long speech :)

What I want in my back-office :

Image

What I want in my front office :

Image
OR
Image

:D
*** If you don't know: Learn. If you know: Share. ***
OK, I see.
But then this, I thought, would have been easy for you to figure out :)

Anyways, suppose your definition for the editable regions is as follows
Code: Select all
<cms:editable
  name='afficher_gallerie_1'
  label='Afficher la gallerie?'
  opt_values='Oui | Non'
  opt_selected = 'Oui'
  type='dropdown'
/>
<cms:editable name='titre_image_1' type='text' />
<cms:editable name='image_1' type='image' />
<cms:editable name='image_mini_1' type='image' />

where 'afficher_gallerie_1' is the name of the dropdown, we can easily check the value selected in the dropdown on the front-end and then show the other regions like this -
Code: Select all
<cms:if afficher_gallerie_1='Oui' >
    <!-- show gallery -->
    <cms:show titre_image_1 />
    <cms:show image_1 />
    <cms:show image_mini_1 />
</cms:if>

Doe this help?
Thank you ! it works !

There is just to add

Code: Select all
hidden='1'


to the dropdown menu.

Thank you :)
*** If you don't know: Learn. If you know: Share. ***
You are welcome :)
Glad it helped.
6 posts Page 1 of 1
cron