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

Is it possible to do the following in the back end.
I want to have repeatable region. Which can be used to upload:
1. Image or
2. Video URL.

Now what I am looking for is, When a radio button is selected for
1. Image it should show a browse option (editable with type='image')
2. video it should show a text field (editable with type='text')

I have created a simple html code for displaying the different input types which i have attached here in. (
text.zip
(442 Bytes) Downloaded 385 times
)

On the couch end i have the following:
Code: Select all
<cms:repeatable name='gallery' label='Gallery' order='1' >
    <cms:editable name="gallery_item" label="Gallery Item" opt_values='Select one | Image=0 | Video=1' type='radio' />
</cms:repeatable>


What should i do to integrate the code in the attached file with the repeatable region, so that the browse option is shown when IMAGE is selected and TEXT Field is shown when Video is selected.

Regards,
GenXCoders

P.S. Is this possible to be done in couch?
Image
where innovation meets technology
Not possible at the moment, I am afraid.

As a workaround, you can simply define both the fields (image and text) and instruct the user to fill any one in each row.
On the frontend, you code can check which of the two regions has any data and then display it accordingly.

Hope it helps.
KK Sir,
can you suggest me a small snippet?

Regards,
Aashish
Image
where innovation meets technology
To give you a gist -
Code: Select all
<cms:repeatable name='booked'>        
    <cms:editable name='image' type='image' />
    <cms:editable name='video' type='text' />
</cms:repeatable>   


Code: Select all
<cms:show_repeatable 'booked' >
    <cms:if image >
        <b>Image:</b>
        <cms:show image />
    <cms:else />
        <b>Video:</b>
        <cms:show video />
    </cms:if>
    <br>
</cms:show_repeatable>

Hope it helps.
4 posts Page 1 of 1