Forum

Thread tagged as: Question, Problem

YouTube - FieldTypes

I am looking at embedding youtube video to my site -

I have followed the instructions - listed here: https://docs.grabaperch.com/addons/field-types/youtube/

The first line under installation and configuration says - Download and place the youtube folder within perch/addons/fieldtypes - I can see anything to download?

I have setup the API Key which I have added to the config file, I have also added the player parameters to the site but all I see on the page is the YouTube URL not the embedded video?

Any advice would be gratefully received.

Alex

Alex Brewer

Alex Brewer 0 points

  • 1 month ago

Hello Alex,

You can download the YouTube field type from here (last one on the list): https://addons.perchcms.com/archive

And to output the video you need to use the output attribute:

<perch:content id="video" type="youtube" width="800" label="YouTube URL" output="embed" />

Thanks Hussein

I've downloaded and added to the site.

When I edit the region - I copy the youtube link and I can see the preview of the youtube video appears under the URL.

When I submit I get the following error above the CMS screen

Warning: Division by zero in /var/sites/b/bravepr.co.uk/public_html/admin/addons/fieldtypes/youtube/youtube.class.php on line 123

Warning: Cannot modify header information - headers already sent by (output started at /var/sites/b/bravepr.co.uk/public_html/admin/addons/fieldtypes/youtube/youtube.class.php:123) in /var/sites/b/bravepr.co.uk/public_html/admin/core/lib/PerchUtil.class.php on line 1405

Warning: Cannot modify header information - headers already sent by (output started at /var/sites/b/bravepr.co.uk/public_html/admin/addons/fieldtypes/youtube/youtube.class.php:123) in /var/sites/b/bravepr.co.uk/public_html/admin/core/lib/PerchUtil.class.php on line 1406

Warning: Cannot modify header information - headers already sent by (output started at /var/sites/b/bravepr.co.uk/public_html/admin/addons/fieldtypes/youtube/youtube.class.php:123) in /var/sites/b/bravepr.co.uk/public_html/admin/core/lib/PerchUtil.class.php on line 1407

Warning: Cannot modify header information - headers already sent by (output started at /var/sites/b/bravepr.co.uk/public_html/admin/addons/fieldtypes/youtube/youtube.class.php:123) in /var/sites/b/bravepr.co.uk/public_html/admin/core/lib/PerchUtil.class.php on line 1413

Warning: Cannot modify header information - headers already sent by (output started at /var/sites/b/bravepr.co.uk/public_html/admin/addons/fieldtypes/youtube/youtube.class.php:123) in /var/sites/b/bravepr.co.uk/public_html/admin/core/inc/top.php on line 17

Any ideas?

You may need to specify the height too:

<perch:content id="video" type="youtube" width="800" height="450" label="YouTube URL" output="embed" />