Add css class to <P> tag as default on the rich text editor

230 views
Skip to first unread message

Juan Simon Rico Jimenez

unread,
Dec 2, 2014, 6:00:14 PM12/2/14
to hippo-c...@googlegroups.com
Hello,

I have a requirement to set the class for all paragraphs in a text to an custom defined class, to add the text i'm using the richtext editor on the cms, but i need all the <p> tags to have this class does anyone know how to do this... i tried using the configuration of the CKeditor adding this to the ckeditor.config.overlayed.json property of the richtext field: 
{format_p : { element: 'p', attributes: { 'class': 'paragraph' } }} 

but had no luck with it.


Thanks

Mathijs den Burger

unread,
Dec 4, 2014, 6:43:58 AM12/4/14
to hippo-c...@googlegroups.com
Hi Juan,

Hippo uses it's own CKEditor styles set definition, with by default a
plain 'p' tag for the 'Normal' style. You can replace the default
Hippo styles with your own by adding a custom styles set definition
and using that in your HTML field(s). In your custom styles set you
can then define that, for example, the 'Normal' style should be a 'p'
tag with a class 'paragraph'.

How to customize the Hippo styles set is explained at
http://www.onehippo.org/library/concepts/document-types/html-fields/customize-ckeditor-styles.html

best,
Mathijs
> --
> Hippo Community Group: The place for all discussions and announcements about
> Hippo CMS (and HST, repository etc. etc.)
>
> To post to this group, send email to hippo-c...@googlegroups.com
> RSS:
> https://groups.google.com/group/hippo-community/feed/rss_v2_0_msgs.xml?num=50
> ---
> You received this message because you are subscribed to the Google Groups
> "Hippo Community" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to hippo-communi...@googlegroups.com.
> Visit this group at http://groups.google.com/group/hippo-community.
> For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages