Hello, I am trying to set up template which will allow my client to paste in youtube/vimeo embed code to display a video on the front end. The video will be contained within a particular div (required to ensure responsiveness). However I want it so that if no embed code is entered, then nothing will show on the front end - ie. the containing div will not show.
Originally I set the video up as a repeatable region and followed this thread :http://www.couchcms.com/forum/viewtopic.php?f=4&t=8256 but have now realised that not_empty doesn't work with textarea which is why my code isn't not working.
This was my code:
<cms:capture into='my_video'>
<cms:show_repeatable 'video' >
<cms:if "<cms:not_empty videolink />" >
<cms:show videolink />
</cms:if>
</cms:show_repeatable>
</cms:capture>
<cms:if "<cms:not_empty my_video />" >
<div class="video">
<cms:show videolink />
</div>
</cms:if>
Can you suggest an alternative way that I could achieve the same kind of thing (ie. if no video embed code is entered, the containing div will not appear)? I don't necessarily need it to be repeatable region as there will only ever be one video per template getting posted...
Originally I set the video up as a repeatable region and followed this thread :http://www.couchcms.com/forum/viewtopic.php?f=4&t=8256 but have now realised that not_empty doesn't work with textarea which is why my code isn't not working.
This was my code:
<cms:capture into='my_video'>
<cms:show_repeatable 'video' >
<cms:if "<cms:not_empty videolink />" >
<cms:show videolink />
</cms:if>
</cms:show_repeatable>
</cms:capture>
<cms:if "<cms:not_empty my_video />" >
<div class="video">
<cms:show videolink />
</div>
</cms:if>
Can you suggest an alternative way that I could achieve the same kind of thing (ie. if no video embed code is entered, the containing div will not appear)? I don't necessarily need it to be repeatable region as there will only ever be one video per template getting posted...