ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

How can I disable image width and height attributes when inserting with RTE?

August 27, 2014 3:21pm

Subscribe [1]
  • #1 / Aug 27, 2014 3:21pm

    turbo255

    45 posts

    (EE v2.7.2)

    I have a responsive layout for my clients site and have the proper css already set up for images that get added to text articles with the RTE.

    However when adding images with the RTE the width and height attributes get added like so:

    https://ellislab.com/asset/images/team-photo/my_photo.jpg

    Is there a way to disable this so I get a result like this:

    https://ellislab.com/asset/images/team-photo/my_photo.jpg

    The css I’m using for the article images looks like this:

    .article_img_left {
    float: left;
    width: 33%;
    padding: 0px 20px 5px 0px;
    }

    There has to be a better way than just manually deleting the attributes from the image after adding it right?

  • #2 / Sep 04, 2014 6:09pm

    turbo255

    45 posts

    Thoughts anyone?

    Similar question was asked here but I’m not seeing quite the same code in rte.image.js as he was here:
    http://expressionengine.stackexchange.com/questions/4805/default-to-no-styling-images-in-ees-rich-text-editor

    There has to be something I can edit in that js file to remove the attr’s right?

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases