AndréPortuga Posted March 24, 2020 Share Posted March 24, 2020 Does anyone knows if there is a way of selecting a iframe inside a textfield(using ckEditor)? I mean I have a Iframe with this code: <iframe allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen="" frameborder="0" height="315" scrolling="no" src="https://www.youtube.com/embed/PMaFJjZDrYM" width="100%"></iframe></p> but it's not getting responsive in iPhones.. So anyone know how can I select it via code for making it responsive? Thank you, Link to comment Share on other sites More sharing options...
adrian Posted March 24, 2020 Share Posted March 24, 2020 For a video embed, use this module: http://modules.processwire.com/modules/textformatter-video-embed/ and select the responsive option. If you need to tweak more settings on the video, then also install this: http://modules.processwire.com/modules/textformatter-video-embed-options/ Link to comment Share on other sites More sharing options...
AndréPortuga Posted March 24, 2020 Author Share Posted March 24, 2020 Is there a way of changing the width and height with http://modules.processwire.com/modules/textformatter-video-embed/ ? Thanks Link to comment Share on other sites More sharing options...
adrian Posted March 24, 2020 Share Posted March 24, 2020 7 minutes ago, AndréPortuga said: Is there a way of changing the width and height with http://modules.processwire.com/modules/textformatter-video-embed/ ? Thanks Did you read the configuration notes in the module's description ? "You may want to update the max width and max height settings on the module configuration screen." Link to comment Share on other sites More sharing options...
AndréPortuga Posted March 24, 2020 Author Share Posted March 24, 2020 8 minutes ago, adrian said: Did you read the configuration notes in the module's description ? "You may want to update the max width and max height settings on the module configuration screen." I actually did. But that makes all my videos be with that same width and height. That's not what I want. Using the module: Using Iframe: Link to comment Share on other sites More sharing options...
adrian Posted March 24, 2020 Share Posted March 24, 2020 Are you embedded into a body of text that is wider than what you want the video to be? If the video is on its own, I would recommend checking the responsive checkbox and outputting this field inside a div with the max width you want. If not, then it might actually be easier to use the Hanna code module - then you can specify the url and width you want for each video separately, without the mess of trying to embed an iframe into an RTE field. Let us know if you decide to go this route and need help. Link to comment Share on other sites More sharing options...
AndréPortuga Posted March 24, 2020 Author Share Posted March 24, 2020 Yes I'am embedding into a wider body text. Link to comment Share on other sites More sharing options...
adrian Posted March 24, 2020 Share Posted March 24, 2020 1 hour ago, AndréPortuga said: Yes I'am embedding into a wider body text. Then try the Hanna code approach and set up attributes for the video ID, and max width / height and wrap the iframe in a container. Google embed video responsively and you'll get tutorials on how the wrapping works. You might end up with a shortcode format like this that lets you insert that into the RTE with the video ID and a max width and the Hanna code takes care of inserting these into the wrapper and iframe HTML. [[video_embed id="" width="500"]] 1 Link to comment Share on other sites More sharing options...
AndréPortuga Posted March 24, 2020 Author Share Posted March 24, 2020 24 minutes ago, adrian said: Then try the Hanna code approach and set up attributes for the video ID, and max width / height and wrap the iframe in a container. Google embed video responsively and you'll get tutorials on how the wrapping works. You might end up with a shortcode format like this that lets you insert that into the RTE with the video ID and a max width and the Hanna code takes care of inserting these into the wrapper and iframe HTML. [[video_embed id="" width="500"]] I actually solved as this way. .internal-text iFrame { display: block; max-width: 100%; height: auto; } where .internal-text is the class that I have in my div <div class="internal-text"> <?php $image = $page->cover_image; echo "<img src='$image->url' style='width: 100%;'>" ?> <br> <?php echo $page->body; ?> Thank you so much Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now