Not much on the forum relating to this, I know you can insert double curly’s or just use the inspector to add data to most elements, but what I’m trying to do is add a dynamic property on a youtube video embed iframe snippet, e.g. the video ID - so then I could switch out which video is displaying based on the id in the dB.
I’ve tried the curly brackets within the iFrame on the YouTube video embed url, and I’ve tested the same curly brackets as a basic paragraph element - it displays the right data but it doesn’t appear to work with a video within an iFrame.
Your syntax doesn’t look right. To make an HTML attribute dynamic you need to add dmx-bind: in front of it. Also the static part needs to be wrapped in single quotes and you don’t need curly brackets for the dynamic part.
Not sure if this is going to work with iframes but please try:
Sorry for bumping this up, but I was trying to achieve kinda the same - but it wouldn’t work.
I have variable which holds PDF file filename and I would like to dynamically display it inside the page.
<dmx-value id="var1" dmx-bind:value="'Q2021-1.pdf'"></dmx-value>
And display code is: <div class="col-12"><embed dmx-bind:src="'pdf/' + var1.value" type="application/pdf" width="100%" height="600px"></div>
Could you please help me out with this?
Server type: NodeJS
With this code works as expected: <div class="col-12"><embed src="pdf/Q2021-1.pdf" type="application/pdf" width="100%" height="600px"></div> but this one - doesn’t - <div class="col-12"><embed type="application/pdf" width="100%" height="600px" dmx-bind:src="'pdf/Q2021-1.pdf'"></div>
Just a thought. Could you create a placeholder pdf that’s 600px high that is the static src. I wonder if it needs a src property when added to the DOM before it gets updated by the dmx-bind
OK I think this is one for the Wappler team. It will probably be something to do with how embed works and the scope that dmx-bind can apply to. As this thread has been marked as solved, it might be worth adding it as a separate topic