Gazley Posted August 17, 2012 Share Posted August 17, 2012 Hi there, I'm now inserting images into Rich Text Editors and learned that the height and width values are being explicitly set on the image tags. Can this behaviour be turned of so no dimensions are set? Thanks. Link to comment Share on other sites More sharing options...
Soma Posted August 17, 2012 Share Posted August 17, 2012 Ok let me search that for you Link to comment Share on other sites More sharing options...
Gazley Posted August 17, 2012 Author Share Posted August 17, 2012 Sorry Link to comment Share on other sites More sharing options...
MarcC Posted August 17, 2012 Share Posted August 17, 2012 Helpful? http://www.tinymce.com/wiki.php/Configuration:extended_valid_elements 1 Link to comment Share on other sites More sharing options...
Gazley Posted August 18, 2012 Author Share Posted August 18, 2012 Hi Marc, Thanks for this link! I haven't used TinyMCE before and am still getting to grips with ProcessWire. However, I'm sure it will help and I'll read it up thoroughly. Cheers Link to comment Share on other sites More sharing options...
Gazley Posted August 18, 2012 Author Share Posted August 18, 2012 Hi Marc, Just to let you know that the following line: extended_valid_elements:img[src|id|class|alt] In the "Additional TinyMCE setting" textbox gives me exactly what I want! Many thanks! --Gary 1 Link to comment Share on other sites More sharing options...
apeisa Posted August 18, 2012 Share Posted August 18, 2012 That method probably loses the image dimensions when you edit image again? Just like this method. Link to comment Share on other sites More sharing options...
Gazley Posted August 18, 2012 Author Share Posted August 18, 2012 You mean if you initially resized the image? I'm unfamiliar with the exact workings of images but if they are resized after changes in the "Edit Image" page, I assumed it created another instance of the image with a different URL. If so, wouldn't the generated <img> tag still point to the correctly re-sized image? I read your other thread yesterday, which was pointed out to me by Soma. I couldn't draw a conclusion from your comment. Are you suggesting that Ryan's suggestion to strip the height/width using a formatter is the better approach? Thanks! Link to comment Share on other sites More sharing options...
apeisa Posted August 18, 2012 Share Posted August 18, 2012 It does create a different image, that is not problem. But after initial image resize, when you next time edit the image in TinyMCE, the editor doesn't remember the width anymore and fallbacks to original size. Example: if you want to change left alignment to right, you also need to do resizing again, since TinyMCE doesn't know the size (it reads those from height and width attributes apparently). Link to comment Share on other sites More sharing options...
Gazley Posted August 18, 2012 Author Share Posted August 18, 2012 So do you recommend Ryan's solution? Link to comment Share on other sites More sharing options...
apeisa Posted August 18, 2012 Share Posted August 18, 2012 Yep, I think it is the best way to go here. Link to comment Share on other sites More sharing options...
Soma Posted August 18, 2012 Share Posted August 18, 2012 Sorry I didn't really mean it, but I thought it's something I would search first and then ask if nothing found. And as I know there was such a thread already I wanted to search it as I know it can be hard to find things here sometimes. I also suggest to use google "site:processwire.com keyword" search as it will be much more successful. 1 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