Page 1 of 1

Using CSS styles inside an entry

Posted: Sat Apr 28, 2007 12:22 am
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

Re: Using CSS styles inside an entry

Posted: Sat Apr 28, 2007 7:09 am
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)

Re: Using CSS styles inside an entry

Posted: Sat Apr 28, 2007 10:44 pm
by bebr
snafu wrote:.. redefine italic in your css ..
R.U. Sirius ?

Re: Using CSS styles inside an entry

Posted: Sun Apr 29, 2007 12:56 pm
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 ?

Re: Using CSS styles inside an entry

Posted: Sun Apr 29, 2007 2:53 pm
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 ;-)