Personal tools
You are here: Home Plone Book Kupu Kupu Styles
Document Actions

How to add a new style to Kupu Paragraph Styles?

by Olha Pelishok last modified 2008-03-10

This article applies to Kupu 1.4.x - Plone 3.0.x, Plone 2.5.x, Plone 2.1.x

Imagine you need to change the size of letters or their color in Kupu WYSIWYG editor. It is well-known that preferable way to do it with Kupu is to do it with the help of paragraph styles written in Kupu Configuration. A special line can be added to standard styles drop-down menu. Apart from such standard paragraph styles as normal, heading, subheading, etc. you can add any style you like.

Go to Kupu Configuration (Site setup -> Kupu visual editor -> Kupu Configuration). In the lower half of the page you will find a title Paragraph Styles. Now there are standard Kupu styles written:
styles1
We can easily add more lines here, so as to enlarge our style pulldown. Let's create a new style, that will make letters red-colored and a little smaller, than they are when Normal style is selected. The title of this style is SmallText, smalltext - its className. We enter the line:

SmallText|p|smalltext

So, our Paragraph Styles list is now enlarged by the last line to:

styles2
So that this style works, it has to be included into ploneCustom.css file. This is done through Zope interface. Add /manage to the site url to see your site through Zope interface. In the opened window choose portal_skins -> plone_styles -> ploneCustom.css (Plone Custom CSS).

plone-styles


In the opened window you will see a standard text, to make the changes we need, press Customize.

customize

Now the script can easily be edited. First of all we delete the line indicated and put the stuff we need.

customization

As we called our style smalltext, we have to put (the order of lines and their number is to be preserved):
.smalltext {
background-color: red;
font-size: 70%;
}
Save the changes. Return back to Plone skin, now when you work with Kupu, you will notice a new line in a style pulldown:

kupu-styles

Let's select the first paragraph of the text, make it SmallText. And save the edits. What we get is a selected text in small letters on a red background.
small

The HTML code generated by this style will be <p class="smalltext">.......</p>:

htmlcode

The next time you want to edit styles, go right to /portal_skins/custom/ploneCustom.css/manage_main.

Colors in Kupu

In case you want to add colors to Kupu without creating a new style, note that Kupu does not have color styles enabled by default. That is why you may end up getting errors while trying to add colors in Kupu.

To enable Kupu colors you have to add two styles to Permitted styles at HTML Filtering -> Styles -> Permitted Styles:
  • color
  • background-color
permitted

Save changes. Reload page you were editing and colors should work then.

cannot add new style

Posted by Silvia at 2008-03-10

Hi, I followed all the above steps for Plone3.0 but didn’t work. Also cannot use background and color in edit mode; Gives me some js error. Anyone has the same problem like me? Thanks


cannot add new style

Posted by Olha Pelishok at 2008-03-10
Hello,
Background and color are not allowed by Kupu be default. That is why to enable colors in Kupu you have to add these two styles to 'permitted styles' at HTML Filtering -> Styles -> Permitted Styles.

Try to add two new Permitted Styles there:
* color
* background-color
Save changes. Reload page you were editing and colors should work then.

Plone Themes
  • Schools Plone Theme
  • Lite Plone Theme
  • Techlight Plone Theme
 

Powered by Plone