[pmwiki-users] WikiStyles (I think) question

Kathryn Andersen kat_lists at katspace.homelinux.org
Wed Sep 20 20:49:38 CDT 2006


On Wed, Sep 20, 2006 at 07:44:57PM -0500, Tegan Dowling wrote:
> On http://pmwiki.org/wiki/Test/BackgroundImage, I've placed an example
> of a bit of text over a background image that I'm trying to figure out
> a way to make simple, so that a single graphic, on a client's site,
> could be reused multiple times on their site, each time with a
> different link over it.
> 
> The clients would definitely be put off by all of the markup required
> to make this work, as it stands.   Is there a way to define and use a
> wikistyle (or otherwise pre-define a chunk of the code) and put it in
> a file on the server (e.g. the config.php or skin's .css file) or even
> into a GroupHeader or other such page on the wiki itself, so that what
> an author has to copy-paste-modify is much simpler?

Yes.

What you can do is use CSS classes defined in a CSS file.

In either the skin's .css file, or in pub/css/local.css (depending
on whether you want it to be specific to the skin or always used
site-wide) you would define your CSS class; for example:

.mycuteimage {
        height: 68px;
        width: 83px;
        color: red;
        background:url(http://www.wikignome.com/Site/HomePage?action=download&upname=coverpoint.gif)' white;
}
(:divend:)

And then inside the wiki, use the class, say, in a div

>>mycuteimage<<
[-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'''[[Main/HomePage|Demo]]'''-]
>><<

Though it might make more sense to do the placement
and formatting of the link with CSS, as follows:

.mycuteimage a {
        margin-left: 5em;
        font-weight: bold;
        font-size: smaller;
}

Then you could just have
>>mycuteimage<<
[[Main/HomePage|Demo]]
>><<

I love CSS. 8-)

Oh, and the color style didn't work because the text is inside a link,
rather than being unmarked text.  To make the link text red, you would
add something like this to your CSS file:

.mycuteimage a:link {
        color: red;
}

And you should probably add something for visited links too.

.mycuteimage a:visited {
        color: green; /* or some other colour */
}

See http://www.pmwiki.org/wiki/Cookbook/CSSInWikiPages
if you want to define styles in Wiki pages rather than in skin.css or
local.css files.

Kathryn Andersen
-- 
 _--_|\     | Kathryn Andersen	<http://www.katspace.com>
/      \    | 
\_.--.*/    | GenFicCrit mailing list <http://www.katspace.com/gen_fic_crit/>
      v     | 
------------| Melbourne -> Victoria -> Australia -> Southern Hemisphere
Maranatha!  |	-> Earth -> Sol -> Milky Way Galaxy -> Universe




More information about the pmwiki-users mailing list