Hot answers tagged

4

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


2

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 experiences - I would look into destroying the modal instance and reloading new content in one modal, as opposed to having multiple modal for multiple content. ...


2

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 easier to understand and work with. Moving on, in your example you appear to have confused the roles of the template being embedded, and the template doing the ...


2

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 %}, so if a template wants to include the partial and make changes to the form, they can just redefine the form themselves. partial_with_form.twig: {% block ...


1

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 }}. For (a little) more info about the raw filter: Here's the twig docs


1

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('petition_after_fields') is defined ? block('petition_after_fields') %} {% embed 'form' %} {% block petition_after_fields %} {{ ...


1

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 video) it triggers a big PHP error: Embed\Exceptions\InvalidUrlException <url> malformed


1

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-responsive--mb-l embed-responsive-16by9"><iframe src="{{ embed }}" width="100%" height="600" frameborder="0" webkitallowfullscreen mozallowfullscreen ...


1

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 need to worry about them. There's many reasons why you might not be seeing anything show up in your templates. You also said it sometimes breaks the page ...


1

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 access to foo. Hope that helps!


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