Jump to content


Photo

Tiny MCE - adding new functionality

tinymce

  • Please log in to reply
1 reply to this topic

#1 ejdamd

ejdamd

    Newbie

  • Members
  • Pip
  • 4 posts
  • 0

Posted 22 February 2012 - 02:59 PM

Hello guys,

I'm struggling with customization of Tiny MCE toolbar in Processwire administration. I didn't found many topics regarding this on Forum page so there will probably be someone who can easily help me. ;)

I am trying to add some standard functionality to TinyMCE. I found this file:

mysite/admin/wire/modules/Inputfield/InputfieldTinyMCE/InputfieldTinyMCE.module

According to tutorials and manuals about TinyMCE I found this part of code and tried to update it with more functions:


protected $defaults = array(
'theme_advanced_buttons1' => 'formatselect,styleselect|,bold,italic,underline|,bullist,numlist,|,link,unlink,|,image,|,code,|,fullscreen',
'theme_advanced_buttons2' => 'strikethrough,justifyleft,justifycenter,justifyright,justifyfull,undo,redo,tablecontrols',
'theme_advanced_blockformats' => 'p,h2,h3,h4,blockquote,pre,code',
'plugins' => 'inlinepopups,safari,table,media,paste,fullscreen,preelementfix',
'valid_elements' => '@[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,-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],pre,code',
);

I added some functions to variable: theme_advanced_buttons2

Unfortunately it didn't work properly in Tiny MCE as you can see on picture below:

tinymce.jpg

Thanks for any help!

#2 ryan

ryan

    Hero Member

  • Administrators
  • 5,773 posts
  • 3122

  • LocationAtlanta, GA

Posted 23 February 2012 - 10:25 PM

Welcome to the forum! I'm on a mobile phone, so have to keep it short--Those 'defaults' settings are really only good for when the field is first created. Your best bet is to edit the settings of the field using tinymce instead. You'll find this by editing the textarea field, clicking to details, then editing the tinymce advanced options'.





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users