Bricks Version: 1.3.7 Browser: Chrome 96.x OS: Windows URL: (a link to a page that illustrates the issue would be really helpful)
Hi,
I’ve been trying to see if this is a bug or if I’m doing something wrong. I saw in another post you would use the ‘code block’ to place an iframe. I have a CPT with a ‘text’ field in it that houses the ‘iframe’ code from google maps. Great. I however, can’t seem to get it to display when using the dynamic data option in the code block element and pull the field in nor can I get it to show if manually putting the code in the code box as well. The only way I’ve been able to get the map to show is by using a ‘basic text’ element, and pasting the code directly into the text box. The dynamic option doesn’t work on this either.
So, it does work at least, but textblock w/dynamic and codeblock manual & dynamic do not work. Any suggestions?
I found the issue, but it appears it was either intentional, or a bug in that it was missed to allow execution of the code when pulled in from a dynamic location such as a ACF field. @timmse Thoughts?
the code execution is a security feature to make sure that only allowed code will be executed. As long as the code is dynamic, you can’t control it because you don’t know what will be executed.
What you can do instead is to use the code block and render the field with PHP (check the ACF documentation for more customization options):
<?php
$iframe = get_field('textarea'); //this is your acf field
if($iframe) {
echo $iframe;
}
?>
In that I get there are ‘security’ issues that ‘could’ happen, I would ask why the option however isn’t given for the dynamic use. In that whoever is coding the site is in control of what fields are going to be targeted for execution. I think that option should still be provided to the end user vs. having to code stuff like the above.
Yes, but the one who allows the execution doesn’t have to be the one who enters the code. This is at least for me a logical explanation, but I ask thomas again if this is intentional
@webmate I managed to have an external video iframe with pods and code block in bricks:
The field named ‘video_embed_code’ was of type wysiwyg and I inserted the html iframe code there. On the bricks template for that cpt I added a code block like this:
Might someone know how to do this with a JetEngine CPT? Or put in another way, what is the JetEngine equivalent of ACF’s get_field()?
I’m able to get the iframe URL field using JetEngine Macros (i.e. “%jet_engine_field_name|iframe-url|field_value%”), but I don’t think the Code widget in Bricks support JetEngine Macros