Search Site:

About

Linux

Printers?

Programming

Windows?

Download

Skins

Edit - To Do - AllRecentChanges

Recent Changes Printable View Page History Edit Page

Here are a few hacks that involve modifications to the the pmwiki style sheets.


Opening external links in a new window and making them stand out

This completements the cookbook recipe found on the pmwiki site ExternalLinks

To open external links in new windows, add the following in your local/config.php file:

# Modified URL for external links to open them in a new window
# and mark them with a small image on the right (throught CSS)
$UrlLinkFmt =
  "<a class='external' target='_blank' href='\$LinkUrl'>\$LinkText</a>";

On this site, I have used the same effect used in WikiPedia for their external links.
For instance http://www.slashdot.org , notice the small picture on the right of the link that indicate that this is an external link to this site.

To enable this, you only need to download one of the small images below, place it in your skin directories, for instance pub/skins/pmwiki/external.png and add in the pub/skins/pmwiki/pmwiki.css the following:

#wikibody a.external {
        background: url(external.png) center right no-repeat;
        padding-right: 13px;
}

Now all external links in you main text body will be identified as such.

Right-click and choose save image to download a copy of the images on your PC:

- - - -

If you're using mutliple skins for your site, don't forget to copy the image in your skin folders and modify the CSS for each of them!


Fixing Internet Explorer PNG transparency problems

In Firefox and IE7 there is no problem with PNG images and their transparency alpha channel.
On IE5.5 and IE6 though, if your PNG has some transparency (ie. not 100% opaque), then it will look like crap:

This image as it looks in an image editor showing its checkerboard background through the transparent bits:

actually looks like this in IE:

when it should look like this:

To solve this problem, download the following files and save them in your top pub/skins directory:

    pub/skins/pngbehavior.htc
    pub/skins/blank.gif

Then add the following to your pub/skins/pmwiki/pmwiki.css style sheet :

/* Fix for PNG alpha channel display in IE5.5 and IE6 */
img {
   behavior: url("/pub/skins/pngbehavior.htc");
}

The behavior CSS tag is ignored in non-IE browsers so it will not affect Opera or Mozilla based browsers.

If you're using mutliple skins for your site, don't forget to modify the CSS for each of them!

If you're not saving those new files in pub/skins, you will have to modify the path inside pngbehaviour.htc that points to blank.gif and change the path in the CSS as well, otherwise it won't work!

Reference

Leave your comments below
Enter your comment (no links allowed): Author:

Edit Page - Page History - Printable View - Recent Changes - WikiHelp - Search - RSS -
Page last modified on Thursday 30 November 2006, at 01:47 GMT+8 - Viewed 2747 times