HowToMakeABasicSkin

<< | Cookbook-V1 | >>

Note: The recipes here are for PmWiki versions 0.6 and 1.0 only. For PmWiki 2.0 recipes, see Cookbook.


Why

You could just use the skin that comes with PmWiki, but your site should have your own personal touch! The best part is that if you decide to employ style sheets in your design, you can literally have users choose the skin they like the most!

You might start by looking at the PmWiki.LayoutBasics page to get started, and then using that information to understand what is going on here.

Code for a Basic Skin

 
<html>
<head>
    <title>$HTMLTitle - $WikiTitle</title>
</head>
<body>
    <table width='800' border='0'>
    <tr><td>
        <h1>$WikiTitle</h1>
        <ul>
            <li><a id='browse' href='$PageUrl'>Read</a></li>
            <li><a id='edit' href='$PageUrl?action=edit'>Edit</a></li>
            <li><a id='diff' href='$PageUrl?action=diff'>History</a></li>
        </ul>
        <p><!--PageText--></p>
    </td>
    <td>
        <p><!--wiki:$Group.SideBar Main.SideBar--></p>
    </td></tr>
    </table>    

    <ul>
        <li><a href="#top">Back to top</a></li>
        <li><a href="$ScriptUrl/$[PmWiki/WikiHelp]">$[WikiHelp]</a></li>
        <li><a href="$ScriptUrl/$[Main/SearchWiki]">$[SearchWiki]</a></li>
        <li><a href="$ScriptUrl/$[$Group/RecentChanges]">$[Recent Changes]</a></li>
        <li><a href="$ScriptUrl/$[Main/AllRecentChanges]?action=rss">XML Feed</a></li>
    </ul>
    <p>$[Page last modified on $LastModified]</p>
    <p>Powered by <a href='$ScriptUrl/PmWiki.PmWiki'>PmWiki</a></p>

</body>
</html>

Key points

This skin is not pretty. But, it does happen to illustrate all the points that I feel are key to a template. You can jazz it up with style sheets all you want, but I felt like they might cloud the real message here, so I have left them out. To get an idea of how to use them, check out some of the existing skins on the Cookbook.Skins page, or just check out the one that comes with your installation. It can be found in pub/skins/pmwiki. Back to this example, though, here are the key points to take away from this example.

$HTMLTitle
This is the title of the wiki page you are on.
$WikiTitle
This is the title of your wiki.
$PageUrl
I use this on the Browse link, because it will just show you the page at this address. If you start adding actions to it, you will get different results.
$PageUrl=$action=edit
This is a cool idea, you can still use the same address, but now you send it an action, and in this case it will load the edit box. NOTE: the edit box will load in place of the content you would normally have in the page.
$PageUrl=$action=diff
You can see the history page by loading this link. Again, this will load in place of the page's content.
<!--PageText-->
This tag literally places the content of the current page. Whereever you want the main body of the page to appear, you should place this tag.
<!--wiki:$Group.SideBar Main.SideBar-->
You can place a navigation sidebar on your site by including this tag. Notice that I have placed the $Group.SideBar tag first. If your current page group has a SideBar page, this will display it first, then the Main sidebar. To actually make this a sidebar in this simple example, I have just placed the sidebar in the right column of a table, and the page content in the left column.
$ScriptUrl/PmWiki/WikiHelp
Since I have this as the link target, clicking this link will open up the help system.
$ScriptUrl/Main/SearchWiki
This one will open the search page if the link is clicked.
$ScriptUrl/$Group/RecentChanges
This one shows you the recent changes page.
$ScriptUrl/Main/AllRecentChanges?action=rss
This one gives you an RSS feed of the recent changes. Very handy for the new FireFox!
$LastModified
This is the date this page was last modified.

So now you should have a place to start. You can add the markup for a tabbed interface, next, which you can read about on the HowToMakeATabbedSkin page. pmwiki-2.3.32 -- Last modified by {{DanDube}}

from IP: 85.171.160.186 ip should be disabled by default for security reasons