Jump to content

Selecting a iframe inside a textarea field


AndréPortuga
 Share

Recommended Posts

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

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

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:

image.png.1912b3d553949f7cbe6b1adc80f41030.png

Using Iframe: 

image.png.48bfcb55a6c11f6baab253790a71c142.png

Link to comment
Share on other sites

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

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"]]

 

 

image.png

  • Like 1
Link to comment
Share on other sites

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"]]

 

 

image.png

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Similar Content

    • By nabo
      Hello
      it would be nice if it could be possible to force a unique (or relative) imagefield for CKEditor.
      Example
      Using a repeater matrix (or repeater) with CKEditor field, the primary sources for images are imagefields in the page-repeater fieldset. Obviously I can change the page source, but I need to start from the root and this is not comfortable. In this specific situation the better solution is to have an imagefield in the parent page and force CKEditor to automatically go there... or if you want to have a "media library" go there first.
      Don't know which could be the best "setting system" but in my opinion this is an annoying problem.
    • By joe_ma
      Sorry for asking this question here, but I cannot ask it in the VIP section because I use an version of FormBuilder that is expired.
      I have a fairly simple form on a website done with FormBuilder (PW 3.0.148, FormBuilder 0.2.4) that seems to work quite well. I've tested it with Firefox (88.0.1), Chrome, Opera, Edge and it works in all browsers as expected. The form is embedded in the page by pasting the name of the form in the body field.
      Now my customer tells me, that her Firefox (88.0.1) is blocking the page where the form is embedded: "Firefox may not open this page" for safety reasons.
      I have no clue as to what seems to be the problem here, since the form is on the same server and has the same domain.
    • By fruid
      inserting links i.e. <a>-elements, and only links, inside a CKEditor-summary field outputs the link-text and a weird " /> above the content-div (I'm using markup regions).
      I have no idea where this is coming from, all the other tags work perfectly, and the CKEditor-markup is fine too when adding links. It puts the <a>-element inside a <p> element but should be alright?
      Any hints?
    • By fruid
      I doubt nobody has seen this issue before…
      when I have an <h2> or <h3> or the likes in a CKEditor-body-field and I delete that header, the h-tag is applied to whatever comes next in line. I'm obviously talking about the WYSIWYG-view. Similar bugs occur when applying an h-tag, that tag sometimes encloses the next line as well. Could be that this happens when the next line is in the same "block"-element and not technically a new line but separated with a <br> but not always…
      When will a new version of CKEditor for PW be released or what's a competitive alternative at this point?
×
×
  • Create New...