Jump to content

TinyMCE settings


doolak
 Share

Recommended Posts

Hello there,

i need to add a button to the TinyMCE toolbar - i tried this by modifying InputfieldTinyMCE.module, but no button appears.

Is it possible to change the settings in that file or do i have to do this somewhere else?

Kind regards,

Christian

Link to comment
Share on other sites

The best place to do this is in your field settings. Lets say you've got a field called 'body' that is using TinyMCE. Go to Admin > Setup > Fields and edit that 'body' field. Click on it's "Input field settings". You'll see a hidden section for TinyMCE settings. Click it to open, and from there you can configure TinyMCE's variables. Documentation for these options is at the TinyMCE web site.

Link to comment
Share on other sites

The best place to do this is in your field settings. Lets say you've got a field called 'body' that is using TinyMCE. Go to Admin > Setup > Fields and edit that 'body' field. Click on it's "Input field settings". You'll see a hidden section for TinyMCE settings. Click it to open, and from there you can configure TinyMCE's variables. Documentation for these options is at the TinyMCE web site.

Hi.

I am trying to add a couple of extra formatting options fo a client.

Using the note above I added -

justifyleft,justifycenter,justifyright

to theme_advanced_buttons1

I guess that I need to add something to the 'valid_elements' field, however I am not sure what to add. I tried a couple of 'p align' elements but without success'.

The justify buttons appear when editing the content, the content displays correctly when editing (i.e. left, centre, right etc.) however when I look at the html code, the markup is missing. When I save the page the alignments are ignored.

Any help would be appreciated. I took a look at the TinyMCE website for help, but after about half  an hour and endless pages of config, my brain started to hurt.

Thanks,

Stewart

Link to comment
Share on other sites

Hi Stewrat and welcome to the forums!

I guess that I need to add something to the 'valid_elements' field, however I am not sure what to add. I tried a couple of 'p align' elements but without success'.

TinyMCE uses style="text-align: right" to set alignments. That being said this worked for me:

@[id|class],a[href|target|name],strong/b,em/i,br,img[src|id|class|width|height|alt],ul,ol,li,p[class],h2,h3,h4,blockquote,-p[style],-table[border=0|cellspacing|cellpadding|width|frame|rules|height|align|summary|bgcolor|background|bordercolor],-tr[rowspan|width|height|align|valign|bgcolor|background|bordercolor],tbody,thead,tfoot,#td[colspan|rowspan|width|height|align|valign|bgcolor|background|bordercolor|scope],#th[colspan|rowspan|width|height|align|valign|scope],code,pre

My addition on bold. But beware - if this is something that client will use, it will allow all kind of stuff (colors, font-sizes etc) introduced to your content. I am not sure if you can say something like [style=text-align] (did try that, did allow everything on style) that would allow only the alignment?

  • Like 1
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...