Forum for discussing general topics related to Couch.
4 posts Page 1 of 1
Hi,

I have searched and just confused myself more :D :D
What is the best/correct way to embed video/youtube using the text editor?
(With example if possible :roll: )

Thanks
Hi,

You can use 'shortcodes' to embed videos from within the text editor - please see http://docs.couchcms.com/miscellaneous/shortcodes.html for details.

The above-mentioned mentioned page also has a working example for YouTube videos that you can use/adapt. As an alternative, you may use the following 'all-purpose' shortcode - viewtopic.php?f=8&t=7950

Hope it helps.
Hi KK,
Thanks for that, should've searched the docs instead of forum :roll: :roll:

Quick question though.....
In docs it says to use
Code: Select all
<cms:do_shortcodes><cms:show my_content /></cms:do_shortcodes>


Where
Code: Select all
<cms:show my_content />
is used to show content

I got it working using

Code: Select all
<cms:do_shortcodes><cms:editable name='content' type='richtext' order='4'>
</cms:editable></cms:do_shortcodes>

as I used
Code: Select all
<cms:editable name='content' type='richtext' order='4'>
for the editable region to display content.

Is one way better than the other or does it not really matter?
As far as the <cms:do_shortcodes> tag is concerned, even the following would work -
Code: Select all
<cms:do_shortcodes>[youtube 1aBSPn2P9bg]</cms:do_shortcodes>

Point is that it expects the enclosed contents to have shortcode(s) somewhere in there that it 'expands' to produce the final markup.

<cms:editable name='content' type='richtext' order='4'></cms:editable>, in addition to defining the editable region, also outputs the existing contents within it. So effectively it becomes equivalent to <cms:show 'content' /> - the <cms:do_shortcodes> gets the contents it wants.

TLDR; both versions are fine :)
4 posts Page 1 of 1
cron