Using CSS styles inside an entry

Random stuff about serendipity. Discussion, Questions, Paraphernalia.
Post Reply
bebr
Regular
Posts: 34
Joined: Thu Apr 26, 2007 2:47 am

Using CSS styles inside an entry

Post by bebr »

Hello,
we plan to put interviews in our blog where the questions should have a distinguished style, like "background light green".
What I've seen in CMSes is a way a) to define the styles in a css file, b) have these offered in the wysiwyg editor as possible formats.
So then i would like to mark the question in the text, I'd klick on the "q1" style and get:
<span class="q1">..</span>
rendered in the output.

Is there something like this possible in Serendipity or does a plugin exist? Or have I misunderstood the concept of a blog?

Thanks for hints
// Bernd
snafu
Regular
Posts: 108
Joined: Sat Dec 17, 2005 7:34 am

Re: Using CSS styles inside an entry

Post by snafu »

bebr wrote:<span class="q1">..</span>
try to use the italic tag provided by the editor and redefine italic in your css, using certain background color for example. (Italic does not look good rendered on a normal screen)
bebr
Regular
Posts: 34
Joined: Thu Apr 26, 2007 2:47 am

Re: Using CSS styles inside an entry

Post by bebr »

snafu wrote:.. redefine italic in your css ..
R.U. Sirius ?
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Using CSS styles inside an entry

Post by garvinhicking »

Hi!

There are three ways to solve your wishes. :)

1. Use the internal WYSIWYG editor (or any other) and edits its javascript configuration file where the buttons are found/placed. Like if you use the internal editor, you need to patch htmlarea.js for that. If you use external editors like FCKEdtior or so, that might be easier.

2. Use a plugin like the 'serendipity_event_typesetbuttons' which puts a number of buttons on top of the WYSIWYG editor bar. You can edit that plugin file to add your specific output.

3. You can write up a similar plugin like typesetbuttons, or a plugin that uses javascript commands to tell the WYSIWYG editor which config buttnos to add. Most WYSIWYG editors have a custom javascript API that lets you add buttons also after the editor is added, and you could achieve that via a plugin.

I however favor snafu's method to "override" simple HTML buttons like <quote> or <code> to use the CSS you want.

Best regards,
Garvin
bebr wrote:
snafu wrote:.. redefine italic in your css ..
R.U. Sirius ?
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
bebr
Regular
Posts: 34
Joined: Thu Apr 26, 2007 2:47 am

Re: Using CSS styles inside an entry

Post by bebr »

garvinhicking wrote: 1. ... If you use external editors like FCKEdtior or so, that might be easier.
I chose tinyMCE - and after you opened my eyes for the correct path parameter this seems to be my solution:
http://board.s9y.org/viewtopic.php?p=54974#54974

Thanks for your attention on all those creative user's issues ;-)
Post Reply