[pmwiki-users] css depending on action, image depending on page
Patrick R. Michaud
pmichaud at pobox.com
Sun May 4 10:45:25 CDT 2008
On Sun, May 04, 2008 at 01:07:29PM +0100, James Montaldi wrote:
> 1. The content of the site is contained in a narrow central column of
> width 500px. When one edits, this is inconveniently narrow, so I want
> to have the css change the width of the #content div when action is
> edit. How do I do that?
Easiest way is probably in config.php:
if ($action == 'edit') {
$HTMLStylesFmt['wideedit'] = ' #content { width:800px; } ';
}
> 2. The site has an logo which varies (slightly) from page to page.
> Can I load page-dependent images in the template file? I naively tried
> <img src ="path/$Page.jpg"/>
> but that didn't work.
Yes, it works in the template file -- but {$Page} isn't a valid
page variable. Try <img src="path/{$Name}.jpg" /> or
<img src="path/{$FullName}.jpg" />.
Even better is to use something like
<img src='$PageLogoUrl' />
and then set the value of $PageLogoUrl in config.php and/or
a per-page configuration file.
Pm
More information about the pmwiki-users
mailing list