Hot answers tagged

5 votes

How can I embed an iframe on my site?

Use a text field (not rich text). Then in the output, add "raw" to avoid it stripping any HTML tags. {{ entry.field | raw }}
user avatar
  • 284
2 votes
Accepted

YouTube embeds playing wrong videos

Don't have enough reps to comment - but it does not seem to be a Craft issue - but rather a Bootstrap modal issue. It seems like when you open the video, it updates the id of the video. Based on past ...
user avatar
  • 66
2 votes

Trouble with Twig `embed` tag

I'm going to assume that, as per the use cases in the documentation, embed is a good fit for your requirements. If you're not sure, extends and include are probably a better choice, as they're much ...
user avatar
2 votes
Accepted

pass block into embed and forward to another embed?

If partial_with_form.twig isn’t making any of its own customizations to form.twig, then I’d just include the form.twig template using an {% include %} tag, and wrap that whole thing with a {% block %},...
user avatar
1 vote

How can I configure Craft security so that my site can be embedded in an iframe?

And it was user rrror It helps to spell "Content-Security-Policy" correctly. However, if you still have issues with X-Frame-Options We are using a docker image for craft which includes an ...
user avatar
1 vote

I need to embed some forms into a new site

You can always make a 'Plain Text' field, named iframe and allow it to have multiple lines. You can put your embed code in there. Then you can add the iframe in your template with {{ entry.iframe|raw }...
user avatar
  • 195
1 vote

pass block into embed and forward to another embed?

Hm, seems like you can use block() but it can't be within the embed block. Putting it in a variable first and use that variable in the embed block works. {% set petition_after_fields_block = block('...
user avatar
  • 213
1 vote

Embedding video using Craft 3 'Video Embedder' plugin

Unfortunately, it has causes a big PHP error if 'empty'...If you don’t have any content (i.e. it’s an optional field for someone to add a video embed to the page and the user chooses not to embed a ...
user avatar
  • 439
1 vote

Embedding video using Craft 3 'Video Embedder' plugin

Worked it out - just needed to use the right syntax, for example: {% set embed = craft.videoEmbedder.getEmbedUrl(entry.videoEmbed) %} {% if embed | length %} <div class="embed-responsive embed-...
user avatar
  • 439
1 vote

Instructions for Using Craft "Embedded Assets" Plug-in?

Author of EA here. Adding in that extraAllowedFileExtensions config setting is about all you need to do. Any other configuration is just for "power" users (for lack of a better term) and you shouldn't ...
user avatar
1 vote

Set Parent Template Defined Content to Output in Child Template

You could use include...with, as specified in the Twig Docs here Example for your case: {# in Template C #} {% include 'template-d.twig' with {'foo':'Hello World'} %} This should give Template D ...
user avatar

Only top scored, non community-wiki answers of a minimum length are eligible