Jump to content

tinyMCE stripping <sup> tag


daniel-not-dan
 Share

Recommended Posts

Hi everyone! First time poster, long time listener...

It's been a joy discovering PW over the last week or two - love the support forums and the system in general!

I'm building my first site right now and am having an issue where the TinyMCE editor is stripping my <sup></sup> tags. I need to have "TM" as a superscript so that my text doesn't look like this: CERTIFIED FINANCIAL PLANNERTM, but instead looks like this: CERTIFIED FINANCIAL PLANNERTM. I see that the editor here in the forums has the superscript and subscript buttons, but can't work out how to include them in the TinyMCE editor within the website interface.

Any help with this?

Thanks!

Link to comment
Share on other sites

You can customise TinyMCE exactly the way you would normally, just using the field configuration.

Go to the field (body, for instance) go to the Input tab and click on TinyMCE advanced configuration

In the valid elements add -sub,-sup, to the end of the list (probably after pre so it ends code,pre,-sub,-sup,)

In the theme_advanced_buttons_1 field, add ,sub,sup somewhere.

And that should do it.

Check on the TinyMCE wiki for other stuff you can add.

  • Like 2
Link to comment
Share on other sites

Something I regularly add is this to Additional Settings:

paste_text_sticky: true
paste_text_sticky_default:true
 
This automatically removes formatting from anything pasted into the editor - this can save a lot of mess!
 
And if you want to turn the context menu on, add contextmenu to the plugins field.
  • Like 2
Link to comment
Share on other sites

If you will use superscripts, be aware that they can affect the height of that line. Read the solution to prevent this here http://css-tricks.com/snippets/css/prevent-superscripts-and-subscripts-from-affecting-line-height/

Another thing you can do is activate the "Insert Special Character" button in TinyMCE on the field settings. Then you just have to insert the ™ character where wanted.

You'll find instructions to customize tinyMCE here http://wiki.processwire.com/index.php/TinyMCE

  • Like 1
Link to comment
Share on other sites

Something I have played with before is rather than allow lots of different standard elements, create a series of fixed styles and get users to select those instead.

That has the advantage of being able to match them accurately to the rest of the site as well as having specific styles to deal with in a very fine grained way without affecting other uses of the same elements.

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.
×
×
  • Create New...