WYSIWYG insert image: change default border


(Tom Chadwin) #1

Hello all


If users insert an image in a WYSIWYG, and accept the defaults (as they always do), the IMG tag ends up with hefty inline border 0 styles. Is there a way to remove the default 0 in the insert image pop-up?



Thanks



Tom


(Ashish Karelia) #2

[quote]
Hello all



If users insert an image in a WYSIWYG, and accept the defaults (as they always do), the IMG tag ends up with hefty inline border 0 styles. Is there a way to remove the default 0 in the insert image pop-up?



Thanks



Tom

[/quote]



Hi Tom,

Unfortunately the answer is No, there is no settings in Matrix to do this. 0 is the default used by matrix in the pop up. When the pop up appears, you can see the query string "f_border=0", this is what sets the value in the text box. Only way to blank the text box out is to manipulate this query var.



Ash


(Tom Chadwin) #3

[quote]
Unfortunately the answer is No, there is no settings in Matrix to do this.[/quote]



Hi Ash



Thanks for the reply. Surely this cannot be the right behaviour? Why would we want the default to be to add styling information? That this CSS is inline, and hefty, is even worse. Is it therefore the case that the sites run by everyone here on this forum are peppered with <img src= "http://i0.kym-cdn.com/entries/icons/original/000/000/015/orly.jpg" width="413" height="384" alt="O rly?" style="BORDER-BOTTOM: rgb(0,0,0) 0px solid; BORDER-LEFT: rgb(0,0,0) 0px solid; BORDER-TOP: rgb(0,0,0) 0px solid; BORDER-RIGHT: rgb(0,0,0) 0px solid" />?



Tom


(Nic Hubbard) #4

[quote]
Is it therefore the case that the sites run by everyone here on this forum are peppered with <img src= "http://i0.kym-cdn.com/entries/icons/original/000/000/015/orly.jpg" width="413" height="384" alt="O rly?" style="BORDER-BOTTOM: rgb(0,0,0) 0px solid; BORDER-LEFT: rgb(0,0,0) 0px solid; BORDER-TOP: rgb(0,0,0) 0px solid; BORDER-RIGHT: rgb(0,0,0) 0px solid" />?

[/quote]



Yeah, whenever you use the WYSIWYG editor, this will happen. But, I think that the style code that is added might be browser based. On ours, we only ever see: style="border: 0px solid rgb(0, 0, 0);"



My advice is to just avoid the WYSIWYG editor at all costs. That is what we do, we ONLY use it on News Items.


(Tom Chadwin) #5

Forgive my ignorance: what do you use if not the WYSIWYG editor? Our authors need rich text editing. Is there another way?


Thanks



Tom


(Nic Hubbard) #6

[quote]
Forgive my ignorance: what do you use if not the WYSIWYG editor? Our authors need rich text editing. Is there another way?

[/quote]



Well, I don't really have an alternative for you.



My situation at Pacific Union College is unique I guess. I am the main content editor for the entire site, so I exclusively use RAW HTML divs. I demand clean HTML and following of our style guidelines, so I never want to use the WYSIWYG editor. But, I understand this won't work for everyone, so I don't think that in your case, there are many alternatives.


(Tom Chadwin) #7

Seems like you barely need a CMS at all, Nic.


(Nic Hubbard) #8

[quote]
Seems like you barely need a CMS at all, Nic.

[/quote]



Quite the contrary. I use Dreamweaver to write my HTML. But, Matrix does 1000 more amazing things that I require each day and cannot live without. Rich text editing is just not one of those.


(Ddorall) #9

Hey guys,


I have noticed this happening ONLY when i use Squiz Matrix via Firefox. When i use it via IE, the borders don't show up.



cheers



Daniel


(Aleks Bochniak) #10

Tom,


You could edit the wysiwyg editor Insert Image plugin - but you would need to document this change for future upgrades.



/mysource_matrix/fudge/wysiwyg/plugins/insert_image/insert_image.inc

/mysource_matrix/fudge/wysiwyg/plugins/matrix_insert_image/matrix_insert_image.inc



in these files do a search for:

    border = "0" 
    border = (!image_tag.border) ? "0" : image_tag.border;



Might need to edit this file also:
/mysource_matrix/fudge/wysiwyg/core/utility.js

    case "f_borderWidth":
    	val = parseInt(val);
    	if (isNaN(val)) { val = 0; }
    	style.borderWidth = val;
    break; 

(Tom Chadwin) #11

[quote]
I have noticed this happening ONLY when i use Squiz Matrix via Firefox. When i use it via IE, the borders don't show up.

[/quote]



IE9 here, so different behaviour.


[quote]You could edit the wysiwyg editor Insert Image plugin[/quote]



It's a shared Matrix installation, so I'm not sure I can see this working. Thanks for the pointers, though.



But there is a more basic point: why is the default for that field 0? Why is it not blank? That is what baffles me. I guess I should file a bug, since I can't describe this behaviour as anything else.



Thanks again



Tom


(Hsingh) #12

Hi Tom and everyone,


I was handling a ticket for client on same border issue. I tried and it works for me and worked on client side.



When you open WYSIWYG editor and click image icon to insert an image. On image screen, bottom right, there is “border thickness” set to 0. If remove value 0 then it won’t add border styling. Give it a try and I hope it will work you also.



Please refer the screenshot for reference.



Good Luck!!!



Harinder
Capture.jpg (92.4 KB)


(Tom Chadwin) #13

Hi Harinder


I know that removing the 0 gets rid of the cruft. My point is that that field in the dialog should be empty by default. Most non-tech users will not remove the 0, meaning that sites get filled with the useless inline CSS.



The default should be blank. Easy fix for Squiz.



Tom


(Nic Hubbard) #14

[quote]
The default should be blank. Easy fix for Squiz.

[/quote]



Could you submit a bug report for this?


(Tom Chadwin) #15

[quote]
Could you submit a bug report for this?

[/quote]



Done.



Thanks



Tom


(Tom Chadwin) #16

[quote]
Could you submit a bug report for this?

[/quote]



So I submitted the bug as #5944. It has now been identified as a duplicate of #5523:



http://bugs.matrix.squiz.net/view_bug.php?bug_id=5523



#5523 is closed with status "Not a bug".



Never would I have thought it would be so difficult to get an incorrect default zero removed from a dialog box.



No idea where to go next.


(Aleks Bochniak) #17

My advice is still to edit the wysiwyg plugin and just keep track of that change for future upgrades you might do to matrix.


(Nic Hubbard) #18

[quote]
No idea where to go next.

[/quote]



Hey Tom,



Have you contact Squiz Support about this?