Forum for discussing general topics related to Couch.
19 posts Page 1 of 2
I need some help and guidance as to how to add video in the CouchCMS admin panel. I am assuming that the "flash" button next to the image button is the upload video button. When I hit it, I am directed to a pop up that allows me to upload a video to my root folder (can't to any other folder?). But when I hit select file, it says no bigger than 2 MB, which is a problem because most of my videos are larger. My website is www.globalbabysteps.org. Help?
Hi,

If you are planning to host the videos on your own server, I hope you have taken into account the bandwidth considerations.

The more accepted practice is to host videos on dedicated platforms like YouTube, Vimeo etc. and then insert their embed codes into Couch's editable regions (using 'shortcodes' or a 'textarea' with 'no_xss_check' parameter set to '1').

I'd strongly suggest you take the hosted route.
Please let me know your thoughts.
hmmmm, I am still slightly confused as how to use the shortcodes or how to link a youtube video to the website. My client does not have access to the FTP, so he can't upload the videos to the folder himself, and he wishes to learn how to do all this himself, so it needs to be easy for someone with no knowledge of code or anything.
The process is pretty straightforward for the client once the designer sets up the CMS right for her.

Assuming the video is already uploaded onto YouTube/Vimeo etc. and the client has the embed code with her, we now have two options for setting things up to make it possible for her to add that embed code to the CMS

1. Create a dedicated editable region for the very purpose of holding only the embed code.
The only region that can be used for this purpose is the 'textarea' as it supports setting the 'no_xss_check' parameter to '1' - this instructs Couch not to sanitize whatever is being inputted. Every other type, as a security measure, will 'mangle' the embed code in a bid to 'neutralize' it.

So, an example region could be -
Code: Select all
<cms:editable name='embed_video' label='Video embed code' type='textarea' no_xss_check='1' /> 

To output the code on the front-end simply use the regular
Code: Select all
<cms:show embed_video />

If the number of videos embedded on a page is not fixed, we can use the textarea as a 'Repeatable region' (http://www.couchcms.com/docs/concepts/r ... gions.html).

2. In the method '1' shown above, it is assumed that the embedded video would be shown at a fixed known location on the front-end (i.e. at the spot where we place the <cms:show .. /> tag).

For scenarios where this is not the case and the client would want to show the video(s) at any arbitrary position within the text content being inputted (e.g within a blog post or news story), we can use the 'shortcode' method.

It is documented at http://www.couchcms.com/docs/miscellane ... codes.html. The 4th example on that page pertains specifically to showing embedded YouTube videos.

Hope this explanation serves to make things a little clearer to you.
Do let us know.

Thanks.
Hi, thanks for the reply :)
Sorry, I'm totally terrible with this CouchCMS code, but do I put the show embed video code as a closer? My client's website is "globalbabysteps.org", if you go to the events page, my client would like the videos to be in the two green "Subheading" boxes. Would I simply make that text area editable, or would I have to take out all the text and leave it blank? Thanks.
What about if section with video is in a "blog" page, should I enclosed with tags section in couch > snippets > blog_list.html?
I do not think it is enough to see editable section in couch admin panel, right?
@pawelbary, you need to make the change at whatever place you are trying to show the video - if this happens to be from within a snippet, then that is the correct place.
ok, it is clear, so I modify "blog_list.html" snippet.

I added the code:
Code: Select all
                    <!-- ***** Webinar single Start ***** -->
                    <div class="col-lg-3 col-md-6 col-sm-12">
                
                    <cms:repeatable name='videoBox' >    
                       <cms:editable name='video' label='Video embed code' type='textarea' no_xss_check='1' >
                          <iframe width = "100%" height = "auto" src="https://www.youtube.com/embed/fMf0mrVMGJk" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
                       </cms:editable>
                    </cms:repeatable>
   
                    <cms:show_repeatable 'videoBox' startcount='0' >
                  <cms:show video />
                 </cms:show_repeatable>
   
                    </div>
                    <!-- ***** Webinar single End ***** -->


is there anything else to do in case of snippets?
At this moment there is no editable area in couch cms and video is not visible at all, hmm?
@KK if it is snippet should I change it also to .php?
Snippets don't need the .php extension so no change required there.

Please move the definition of your repeatable region from the snippet and put it in the main template (i.e. blog.php) within the <cms:template> block. (note: the 'name' has to be all lowercase) -
Code: Select all
<cms:repeatable name='videobox' >     
   <cms:editable name='video' label='Video embed code' type='textarea' no_xss_check='1' >
      <iframe width = "100%" height = "auto" src="https://www.youtube.com/embed/fMf0mrVMGJk" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
   </cms:editable>
</cms:repeatable>

Visit blog.php on the frontend as super-admin. Coming back to the admin-panel, you should see the repeatable region.

Leave the code to show the regions in the snippet -
Code: Select all
<cms:show_repeatable 'videobox' startcount='0' >
    <cms:show video />
</cms:show_repeatable>

Does this help?
19 posts Page 1 of 2
cron