Problem/Motivation

When trying to override the video-embed-iframe.html.twig template to wrap a contextual consent around the iframe it is a bit tricky to extract the provider ID. There is only the {{ theme_hook_original }} which is e.g. video_embed_iframe__youtube, so in order to extract youtube you would need to do ugly replacing like:

{% set provider = theme_hook_original|replace({'video_embed_iframe__': ''}) %}

Proposed resolution

Add a provider variable via preprocess so no ugly replacing is needed.

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

yannickoo created an issue. See original summary.

mably made their first commit to this issue’s fork.

mably’s picture

Status: Active » Needs review

A new provider variable should be available in the twig. Please review.

yannickoo’s picture

Status: Needs review » Reviewed & tested by the community

Thank you for this! Really nice that this was the only change to expose it, RTBC!

mably’s picture

Status: Reviewed & tested by the community » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

  • mably committed ca954249 on 3.x
    feat: #3572046 Provide provider ID as variable for Twig template
    
    By:...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.