Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Width and height params do not work #35

Closed
migplay opened this issue Feb 6, 2020 · 5 comments
Closed

Width and height params do not work #35

migplay opened this issue Feb 6, 2020 · 5 comments

Comments

@migplay
Copy link

migplay commented Feb 6, 2020

I am adding the width and height params to make the iframe bigger but it does not work.
I got oEmbed plugin last version (1.2.4).

Here is my twig code :

{{
entry.resourceLinkEmbed.render({
                params: {
                  width: 1000,
                  height: 500,
                  autoplay: 1,
                  rel: 0,
                  mute: 0,
                  loop: 1,
                  autopause: 1,
                }
              })
}}

Et voici le code iframe en output :

image

Thanks for help.

@reganlawton
Copy link
Member

@migswd firstly thanks for submitting an issue.

Now the Param field is used to modify the URL query string not the iframe params. However it seems this isn’t the case for you at all. Do you have cache enabled by chance? The width is normally controlled by CSS HOWEVER I can update the DOM manipulation to support updating the width and height attributes.

@migplay
Copy link
Author

migplay commented Feb 7, 2020

Yes I have cache enabled. I switch it off and I see the url with all params now.
image

So to modify width and height I should use css or do that ?
entry.fieldname.render|replace('width="600"','width="100%"')|raw

That would be great that you update the plugin to take that manipulation in charge yes :)

@reganlawton
Copy link
Member

@migswd you now have the option to override the width and height, see v1.2.5. I'll also be opening an issue / feature where I'll add support to override / set / manage all iframe DOM. attributes to allow overriding of attributes and adding missing / custom attributes as most my issues are managing attributes 😅

THanks for opening an issue and hope this fixes your edgecase 👍

@migplay
Copy link
Author

migplay commented Feb 10, 2020 via email

@jdsimcoe
Copy link

jdsimcoe commented Jun 9, 2020

Hey @reganlawton previously I had two CSS classes on my iFrame that did formatting with. Now, with oEmbed I'm having trouble figuring out how to add these classes via the API. Is there a way to do this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants