Header/Frontmatter - youtube (video) plugin (markdown)

Hello world,

I am following grav from almost the beginning I’ll soonly publish my first website using it. Thanks for your work, that’s a really nice and powerful tool.

I have a question concerning the plugins and the page headers (in frontmatter).

For some reasons I want some markdown in my header page and want to render it. The markdown content is a youtube (or vimeo) video link that I want to ‘embedded’ using the youtube (or vimeo) plugins.

The plugins are working well when the links are in the ‘body’ page but not at all when, in my twig template, I am using the ‘|markdown’ twig function.

If you have an idea how I can enable these plugins to work with the ‘|markdown’ function, or if it’s just not possible (due to how plugins works).

Thanks for any help / idea.

Illustration of my problem :

The page content (normally there will be no video link in the content, that’s just for illustrating that the plugin are working well)

Screen Shot 2017-03-04 at 13

Part of the twig template rendering the page

Screen Shot 2017-03-04 at 13

The rendering result

Screen Shot 2017-03-04 at 13

the |markdown filter simply runs things through the standard markdown parser. Content is processed with all plugins, so that’s simply hot going to work. There’s really no simple solution for this. You would have to change your approach or modify the plugin to fire on a different event to process plugins in the header directly. I’m sure there are many other ways you could create the result you are looking for. For example, you could put a video field in the header, then simply grab that and output an appropriate youtube embed html snippet in your twig.

Thanks rhukster for the answer and the information.

I’ll get it, plugins are not called at all when using the |markdown filter, they are only used to render the main page content.

As you said, there’s many other ways so it’s not a problem, I was just curious about the |markdown filter and when plugins are called.

Best regards,