[pmwiki-users] predefined class attribute inclusion in user editing
Hans
design at flutesong.fsnet.co.uk
Sun Jul 3 14:05:13 CDT 2005
Sunday, July 3, 2005, 6:26:42 PM, Henrik wrote:
> Is there some way for my users to include classes I have in my
> stylesheets as modifiers for the objects they are entering?
> something like %blockquote:class="letter-internal"% (a custom appearance
> to blockquote)
> or do I have to reproduce all those with %define=...
You can define custom styles in config.php, which can be used in all
pages. See PmWiki/CustomWikiStyles for examples and some documentation.
For instance the following defines white text on green background with
10px padding for blocks, used on the wiki page with %style1%
$WikiStyle['style1']['color'] = 'white';
$WikiStyle['style1']['padding'] = '10px';
$WikiStyle['style1']['background-color'] = 'green';
$WikiStyle['style1']['apply'] = 'block';
This gets put in html output as
<p style='color: white; padding: 10px; background-color: green;' >
i.e. applied to the <P> block element.
without the 'apply' = 'block' it gets applied toa <span> inline element.
You can also define classes in a css stylesheet:
For instance put this in your config.php, which associates the class
'redboldblock' with style %alert%:
$WikiStyle['alert']['class'] = 'redboldblock';
and define class reditalic in your stylesheet, for instance
.redboldblock { color: #f00;
font-weight: bold;
background: #ffa;
padding: 5px;
display:block }
Best,
~Hans
More information about the pmwiki-users
mailing list