I am trying to: Use an iframe component in my Views Loop
I expected to see: a formatted iframe in each loop with dimensions X by Y
Instead, I got: While the height of the iframe is correct, the iframe width seems to be automatically filling the entire page.
Please see the attached images of my view loop, the content template mentioned in that loop, and an example of what Im talking about. (Note: in the end, a field called video-url will be placed in the content template, but for testing purposes a google drive link has been placed there)
What I'm trying to do in the end is something like the tutorial posted here:
hidden link
Essentially, I want this iframe to act like a thumbnail of the video found at that URL.
Please let me know if there is possible fix, or if I was unclear about anything.
Thanks!
- Andrew
Looks like you've got things set up well...I wonder if there is some other CSS overriding your style, like in your theme? I can take a look if this is online somewhere.
It is online and I am using the Toolset Starter Theme since it is a pretty fresh website in it's early stages.
I'd be happy to give you a look, the link is below-
[ very early stages, the video with my dogs is just a test post ???? ]
hidden link
Thanks,
Andrew
Okay I see, Layouts resizes iframes in an effort to make videos responsive, expanding to fill the screen width at different resolutions. If you want to override this you can use your own custom CSS with !important:
iframe {
width: 200px !important;
height: 100px !important;
}
If you're looking for a way to override the JS itself, you can find this code in
/wp-content/plugins/layouts/resources/js/ddl-layouts-frontend.js. In a child theme you could theoretically override DDLayout.EmbeddedManager methods, though I have not tested this.