Tinymce and formats /styles

General discussions about WebYep
Post Reply
knuddl
Posts: 4
Joined: Thu Dec 27, 2012 2:00 pm

Tinymce and formats /styles

Post by knuddl » Fri Jan 04, 2013 10:33 am

I use tinymce in advanced mod and want to add some formats like

style_formats : [
{title : 'Bold text', inline : 'b'},
{title : 'Red text', inline : 'span', styles : {color : '#ff0000'}},
{title : 'Red header', block : 'h1', styles : {color : '#ff0000'}},
{title : 'Example 1', inline : 'span', classes : 'example1'},
{title : 'Example 2', inline : 'span', classes : 'example2'},
{title : 'Table styles'},
{title : 'Table row 1', selector : 'tr', classes : 'tablerow1'}
],

formats : {
alignleft : {selector : 'p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li,table,img', classes : 'left'},
aligncenter : {selector : 'p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li,table,img', classes : 'center'},
alignright : {selector : 'p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li,table,img', classes : 'right'},
alignfull : {selector : 'p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li,table,img', classes : 'full'},
bold : {inline : 'span', 'classes' : 'bold'},
italic : {inline : 'span', 'classes' : 'italic'},
underline : {inline : 'span', 'classes' : 'underline', exact : true},
strikethrough : {inline : 'del'},
customformat : {inline : 'span', styles : {color : '#00ff00', fontSize : '20px'}, attributes : {title : 'My custom format'}}
}

In the docu of tiny stands that this should to add by <script type="text/javascript">
tinyMCE.init({

this section can i only find at /webyep-system/programm/editors/rich-text-tinymce.php and when i insert this the editor is blank

Can someone help me?

Max
Rank 4
Rank 4
Posts: 176
Joined: Wed Nov 08, 2006 10:39 pm
Location: UK
Contact:

Re: Tinymce and formats /styles

Post by Max » Thu Jan 24, 2013 1:31 am

why don't you just create a special style sheet with your styles and then refernce that style sheet in the webyep code for example if you created a style sheet called wyrich.css and then added that to webyep code... so something like this depending on the location of where your style sheet is located.

Code: Select all

<?php webyep_richText("Fieldname", false, "wyrich.css", true); ?>



kind regards max

Post Reply