ExternalCSS

<< | Cookbook-V1 | >>

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


Goal

To use external stylesheets.

I have since found Flexlayout by Jason Perkins but thought I would put this up as it uses a different approach.

Solution

=note Note: PmWiki version 0.6 has built-in support for external stylesheets.

I have been playing with various Wiki's for about a month, and have had pmWiki for a week. I am new to PHP but I am finding this Wiki very flexible & resiliant so decided to try something practical. I followed the code in pmWiki.php and lifted out the $HTMLHeaderFmt function and overloaded it in externalCSS.php.

Files

Here is Attach:externalCSS.php and here is Attach:wiki.css. Here is my sample Attach:localStyle.css for a border around code (<pre> in HTML) , sans-serif fonts, blue rulers etc

Installation

To use ExternalCSS

  • put externalCSS.php and wiki.css in your local folder.
  • Then in your local.php, add the line
include_once("local/externalCSS.php");
Note: You need to alter the local/.htaccess file to read
Order allow,deny <Files *.css> Allow from all </Files> Deny from all


As it stands, this does not alter the look of pmWiki in any way. But create a local/localStyle.css (or get mine) to change the look and feel.

Notes
wiki.css contains the default style for the revision pages from pmWiki.php.
If you use my localstyle.css, you need to overload two variables, $BodyLeft & $BodyWidth in local.php for percentage or px based values. e.g. $BodyWidth = '90%'; or $BodyWidth = '600px'; Not as is standard, $BodyWidth = '600' (no px value)

See Also

Flexlayout

History

  • first attempt
  • added per group and per page support and a header of comment to the attached file.

Comments, Bugs

Contributors

  • David Jackson -> mailto:jkz [snail] btinternet [period] com

pmwiki-2.3.32 -- Last modified by {{Pm}}

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