The code block is signed. Code execution is turned on. Everything should be fine. I’ve tried changing the ACF field to text, text area, code, WYSIYG, etc. None of that helps.
If I hardcode the same identical embed code into the page template inside a code block it renders just fine.
How can I get this custom field to load the media player properly on the front end?
I suspect some sanitising is going on. I have a vague memory that ACF won’t pass code.
Could you use a URL field instead, then add a code block with: <script src="{acf_field_name}" type="text/javascript" charset="utf-8"></script>
So all the html is in the script block and ACF just returns the url?
@foliot, I’m attempting something similar and might be running into a similar sanitization issue.
I’ve got a JS embed code from Fusebox where I’ve replaced the podcast episode’s ID with the ACF placeholder, pulling the ID from my ACF text field assigned to the post.
However, nothing is displaying on the front end as seen here:
The code seems to be output just fine in the HTML of the page, but the player is hiding. Unfortunately, this site is under development, so I don’t have a publicly shareable link. Any ideas on what might be going on here?
I placed the script in the PHP/HTML portion of the code element and reformatted the script tags as @Matej with Bricks support suggested in my support ticket, and now I see the podcast player displaying and functioning properly on the frontend:
I was, improperly, placing the embed code for the podcast player in the custom JS tab of the code element. The correct syntax for my particular ACF setup (pulling the podcast episode’s ID from a custom field) is below: