Losing <span> tags when using WYSIWYG

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
chrisinoz
Forum Members
Forum Members
Posts: 67
Joined: Tue Nov 16, 2004 4:17 am
Location: Adelaide, Australia

Losing <span> tags when using WYSIWYG

Post by chrisinoz »

Losing span tags when in wysiwyg mode

Welcome

When I add this in html mode and then update it wipes out the span tags.

I don't want to get rid of WYSIWYG mode as this is for a non-html savvy client.

Is this normal?

Cheers

Chris
Humble web designer
Adelaide, South Australia
chrisinoz
Forum Members
Forum Members
Posts: 67
Joined: Tue Nov 16, 2004 4:17 am
Location: Adelaide, Australia

Losing <span> tags when using WYSIWYG

Post by chrisinoz »

Also it is stripping out my td align=right.

Went into html mode
add made code



 Welcome







I update and the html code reverts back to



 Welcome







The same happens to hspace=5.

Whether I add that through html or through the image editor part it never gets added in.

Cheers

Chris
Humble web designer
Adelaide, South Australia
chrisinoz
Forum Members
Forum Members
Posts: 67
Joined: Tue Nov 16, 2004 4:17 am
Location: Adelaide, Australia

Losing <span> tags when using WYSIWYG

Post by chrisinoz »

Soory to be a pest but this is apaying client and I can't get it work at all as I expected it to.

HTML BLOG

My HTML Code

Weddings


I save Iand I lose the class=menu

Weddings


Turning off WYSIWG will fix all these but is no help to client.

Thanks for any feedback.

Mice = False re stripping css tags.

Cheers

Chris
Humble web designer
Adelaide, South Australia
chrisinoz
Forum Members
Forum Members
Posts: 67
Joined: Tue Nov 16, 2004 4:17 am
Location: Adelaide, Australia

Losing <span> tags when using WYSIWYG

Post by chrisinoz »

I Just checked my original trial site I did with an earlier version and it works perfectly. No span tags are stripped, align=right is retained etc.

I suppose I can go back to that one instead.

BTW just checked my lousy spelling on my last post..sorry about that.

Cheers

Chris
Humble web designer
Adelaide, South Australia
iNSiPiD

Losing <span> tags when using WYSIWYG

Post by iNSiPiD »

I've had the same trouble, chrisinoz. Were you perhaps using HTMLArea before? I don't remember it ever rewriting explicitly added code. Driving me nuts!
chrisinoz
Forum Members
Forum Members
Posts: 67
Joined: Tue Nov 16, 2004 4:17 am
Location: Adelaide, Australia

Losing <span> tags when using WYSIWYG

Post by chrisinoz »

Hi iNSiPiD

Yes it was!

I just noticed on the website that there is HTMLArea available for the latest 0.82 release.

I am downloading it now and installing it as a module as per instructions.

I see some advantages of Mice but stripping of so many tags was sending my head spinning.

Cheers

Chris

http://www.cmsmadesimple.org/modules.shtml
HTMLArea is a replacement WYSIWYG editor. This was the editor that was included in the releases before 0.8, and has been requested by some of our more seasoned users to use instead of TinyMCE. There is a README file inside the zip, that explains the very easy installation prodecure. This will ONLY work for CMSMS version 0.8.2rc1 and above.
Humble web designer
Adelaide, South Australia
chrisinoz
Forum Members
Forum Members
Posts: 67
Joined: Tue Nov 16, 2004 4:17 am
Location: Adelaide, Australia

Losing <span> tags when using WYSIWYG

Post by chrisinoz »

Welcome back HTMLArea :>
Humble web designer
Adelaide, South Australia
iNSiPiD

Losing <span> tags when using WYSIWYG

Post by iNSiPiD »

I'm right behind ya, chrisinoz! :mrgreen:

Problem is that every time I upgrade I've got three sites to do now! AND I have to remember all those files I hacked!! :o

No disrespect, Ted. TinyMCE is a great piece of work but until there's a way to stop it playing with user added code, it's no good to me. :cry:
chrisinoz
Forum Members
Forum Members
Posts: 67
Joined: Tue Nov 16, 2004 4:17 am
Location: Adelaide, Australia

Losing <span> tags when using WYSIWYG

Post by chrisinoz »

Getting on my feet with it now - constructing at

http://belairparkcountryclub.hosting.adam.com.au/

I agree with iNSiPiD - there are a lot of features I like in TinyMCE but have put it on hold for now.

Cheers

Chris
Humble web designer
Adelaide, South Australia
Ted
Power Poster
Power Poster
Posts: 3329
Joined: Fri Jun 11, 2004 6:58 pm
Location: Fairless Hills, Pa USA

Losing <span> tags when using WYSIWYG

Post by Ted »

Yeah, I see that it's a problem. I'm going to dig around TinyMCE's site sometime this weekend and see if I can make it not strip out ANYTHING. We'll see. It sucks, too, because TinyMCE from a technical aspect is SO much better.
Greg
Power Poster
Power Poster
Posts: 598
Joined: Sun Sep 26, 2004 6:15 pm
Location: Saskatchewan - Canada

Losing <span> tags when using WYSIWYG

Post by Greg »

Did some test with TinyMCE.

My findings:


The table cell with align=right works if you use quotes align="right" stays align=right disappears.

The class attribute: the class must exist in the css associated with the template you are using, you cannot add a class in content and then add the css in your css file after. Define the class in your css associated with the template you are using then you can use it in your content. The allowable classes should be in the 'styles' dropdown.

The span: Hello out there doesn't work
Hello out there works as long as the class is defined in css as above.

I am using the valid_elements : "*[*]"[/color] in my modules/TinyMCE/modulefunctions.php file [line ~68] as wishy indicated in another post.

[size=9px]Just discovered that shift enter creates a
in both TinyMce and HTMLArea -- OK, so I'm a little behind[/size] :shock:
Greg
Greg
Power Poster
Power Poster
Posts: 598
Joined: Sun Sep 26, 2004 6:15 pm
Location: Saskatchewan - Canada

Losing <span> tags when using WYSIWYG

Post by Greg »

Some of the settings that could be tested in TinyMCE by modifying modules/TinyMCE/modulefunctions.php
[trim_span_elements] True/False option, if this option is set to true unneeded span element will be removed. Default value is true.

[verify_css_classes] True/False option, if this option is set to true CSS class attributes will be verified against the CSS. Default value is true.

[verify_html] True/False option is the HTML contents should be verified or not. Default value is true.
Greg
chrisinoz
Forum Members
Forum Members
Posts: 67
Joined: Tue Nov 16, 2004 4:17 am
Location: Adelaide, Australia

Losing <span> tags when using WYSIWYG

Post by chrisinoz »

Hi Greg

Thanks for the feedback on this.

I shall see how it goes with the changes.

Cheers

Chris
Humble web designer
Adelaide, South Australia
chrisinoz
Forum Members
Forum Members
Posts: 67
Joined: Tue Nov 16, 2004 4:17 am
Location: Adelaide, Australia

Losing <span> tags when using WYSIWYG

Post by chrisinoz »

Hi Greg

I maybe missing something here but in my modulefunctions.php I see no referene to span or classes and verify_html is set to false by default.

I have the latest download of CMS.

Cheers

Chris
Humble web designer
Adelaide, South Australia
jptechnical
Forum Members
Forum Members
Posts: 131
Joined: Wed Jan 12, 2005 12:18 am

Losing <span> tags when using WYSIWYG

Post by jptechnical »

I had this problem with the html blobs. It seems like it strips the css whatever it is. it initially started with stripping the background images in tables.

the thread is here http://forum.cmsmadesimple.org/viewtopic.php?t=374

I did find the valid_elements part... it was near line 68 I think... it has a long string after it.

here is what the string is

Code: Select all

extended_valid_elements : "a[name|href|target|title|onclick],img[class|src|border=0|alt|title|hspace|vspace|width|height|align
|onmouseover|onmouseout|name],font[face|size|color],hr[class|width|size|noshade],form[name|id|action]"
replace it with

Code: Select all

valid_elements : "*[*]"
that should fix the problem where it strips the html tags without the "" around them as mentioned eariler.

And then wishy said that it would strip the css if it wasnt in the css manager attached to the template. I am not quite sure if his was my fix... but I have been using the css manager for handling all of my css and I love it! So give that a try. Put your css for that template in a css file in the css manager and attach it to the template and give it a whirl.
Locked

Return to “CMSMS Core”