Tiny MCE plugin help

29 views
Skip to first unread message

xxrexdartxx

unread,
Apr 6, 2010, 2:03:35 PM4/6/10
to tinymce_hammer
Hi, i am building a site and using TinyMCE hammer but i am running
into some problems I believe it is in the tinymce_hammer.rb file. When
i save the page some elements will save others will not. For example,
bold text and stikethrough saves and forecolor and backcolor or
centering the text do not.

Am i correct in thinking i am missing something in valid_elements?
Could someone provide an example or a site on getting it to work? I do
not think i understand the syntax for the valid_elements


Here is the code:

Tinymce::Hammer.install_path = ['/javascripts/tiny_mce']
Tinymce::Hammer.plugins = ['style, table, paste, emotions, media,
spellchecker, print, save']
Tinymce::Hammer.languages = ['en']

Tinymce::Hammer.init = [
[:theme, 'advanced'],
[:theme_advanced_toolbar_align, 'left'],
[:theme_advanced_toolbar_location, 'top'],
[:theme_advanced_buttons1,
'undo,redo,cut,copy,paste,pastetext,|,bold,italic,strikethrough,blockquote,charmap,bullist,numlist,removeformat,|,link,unlink,image,|,cleanup,code'],
[:theme_advanced_buttons2,
'forecolor,backcolor,|,formatselect,fontselect,fontsizeselect,|,justifyleft,justifycenter,justifyright,justifyfull,|,hr'],
[:theme_advanced_buttons3, 'save,
styleprops,|,table,tablecontrols,|,emotions, media, spellchecker,
print'],
[:valid_elements, "a[href|
title],blockquote[cite],br,caption,cite,code,dl,dt,dd,em,i,img[src|alt|
title|width|height|align],li,ol,p,pre,q[cite],small,strike,strong/
b,sub,sup,u,ul"],
]

trevorrowe

unread,
Apr 6, 2010, 2:09:58 PM4/6/10
to tinymce_hammer
You can find more information about configuring valid elements here:

http://wiki.moxiecode.com/index.php/TinyMCE:Configuration/valid_elements

Just be warned, this is javascript filtering the content the editor
will return. All a user needs to do is disable javascript and they
can post any information they want through the form, unfiltered. It
is therefore highly recommended you filter user-supplied html server-
side. I recomend HTML sanitizer (http://wonko.com/post/sanitize) for
sanitizing html via a whitelist in ruby. If you filter server size
you could disable client side filtering.

Tedd Griswold

unread,
Apr 6, 2010, 2:20:49 PM4/6/10
to tinymce...@googlegroups.com
Thanks, i was looking at that site. I just could not understand the syntax of it. I will give it another shot. Could you give me an example on how to get the Justify's working? I'm sure i could get the rest

BTW, thanks for the tip regarding the html sanitizer. Ill look into it.

--
You received this message because you are subscribed to the Google Groups "tinymce_hammer" group.
To post to this group, send email to tinymce...@googlegroups.com.
To unsubscribe from this group, send email to tinymce_hamme...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/tinymce_hammer?hl=en.


sockpuppet

unread,
Apr 19, 2010, 4:33:03 AM4/19/10
to tinymce_hammer
Hi!

I've found looking at the "full featured example" at tinymce's main
site useful in finding which elements are missing from the valid list
in hammer. I think your problems can be fixed by adding "span[style]"
and another "[style]" after the "p" element already in the list.
Somewhere along the development of tinymce some formatting methods
must have changed, and this is not reflected in the default
valid_elements in hammer.
> > 'undo,redo,cut,copy,paste,pastetext,|,bold,italic,strikethrough,blockquote, charmap,bullist,numlist,removeformat,|,link,unlink,image,|,cleanup,code'],
> > > [:theme_advanced_buttons2,
>
> > 'forecolor,backcolor,|,formatselect,fontselect,fontsizeselect,|,justifyleft ,justifycenter,justifyright,justifyfull,|,hr'],
> > > [:theme_advanced_buttons3, 'save,
> > > styleprops,|,table,tablecontrols,|,emotions, media, spellchecker,
> > > print'],
> > > [:valid_elements, "a[href|
> > > title],blockquote[cite],br,caption,cite,code,dl,dt,dd,em,i,img[src|alt|
> > > title|width|height|align],li,ol,p,pre,q[cite],small,strike,strong/
> > > b,sub,sup,u,ul"],
> > > ]
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "tinymce_hammer" group.
> > To post to this group, send email to tinymce...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > tinymce_hamme...@googlegroups.com<tinymce_hammer%2Bunsubscribe@go oglegroups.com>
> > .
Reply all
Reply to author
Forward
0 new messages