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 }}
4
votes
can't figure out how to embed youtube videos
This is, most likely, not an issue with Video Embedder, or Craft.
I think you are most likely just seeing the normal behaviour of an iFrame. An iFrame, like any replaced element in html, is 300px wide ...
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 ...
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 ...
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 %},...
1
vote
can't figure out how to embed youtube videos
CSS is your friend, here's some vanilla (SaSS format):
.embed-container
position: relative
padding-bottom: 56.25%
height: 0
overflow: hidden
max-width: 100%
iframe,
object,...
1
vote
can't figure out how to embed youtube videos
Agree, nothing to do with twig/php on this one.
You gotta adjust styles on the iframe to increase the embeded media.
Check the approach used in bootstrap ratios for example.
You can either force a ...
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 ...
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 }...
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('...
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 ...
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-...
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 ...
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 ...
Only top scored, non community-wiki answers of a minimum length are eligible