1

I was planning to do something like the following to embed a youtube video into a grav website using frontmatter (the page is currently using only only frontmatter with no entries in the markup file):

rows:
    -
        title: XYZ
        description: 'Something'
        description_position: left
        image: image.JPG
        name: video
    -
        title: IJK
        description: 'Something'
        description_position: right
        html: '<iframe width="560" height="315" src="https://www.youtube.com/embed/somevideo" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>'

This does not work. Grav does not say that this isn't valid frontmatter but it just doesn't create the iframe either. Is there a way to embed video from youtube using html inline in the frontmatter and without plugins?

The amateur programmer
  • 1,238
  • 3
  • 18
  • 38
  • I would not complain if you could provide a tad more information... Where's the above yaml snippet from? What's the template being used? How does the generated code look like? Do you want the video to be displayed inside the markdown of a page? And whatever other relevant info can you provide... – passerby Sep 04 '20 at 11:58
  • @passerby Snippet is from the web configurator. Where can i see the used template? Where can I see the generated code? I'm completely new to grav. – The amateur programmer Sep 04 '20 at 12:07
  • I'm sorry, but I've never heard of "web configurator" in relation to Grav... – passerby Sep 04 '20 at 12:31
  • @passerby The field where I have the yaml is called Frontmatter. It seems that this page is entirely made with Frontmatter yaml. There is nothing in the markup window at the administrator web interface... – The amateur programmer Sep 04 '20 at 12:46
  • The wording you use leave me clueless... Are you perhaps using a theme based on Gantry? If so, I cannot offer you any help. – passerby Sep 04 '20 at 13:07

2 Answers2

0

You can use the code below

 <//iframe style="position:center;bottom:0px;left:0px;height:100%;width:100%" src="https://www.youtube.com/embed/-5wpm-gesOY" frameborder="0" allowfullscreen></iframe>

(// not use)

Good work

Akif
  • 7,098
  • 7
  • 27
  • 53
0

They also have a dedicated youtube plugin (written by the grav developers) to better integrate into the markdown and frontmatter: https://github.com/getgrav/grav-plugin-youtube

NicoHood
  • 687
  • 5
  • 12