[pmwiki-users] some variable issues

Patrick R. Michaud pmichaud at pobox.com
Fri Mar 25 14:18:48 CST 2005


On Sat, Mar 26, 2005 at 02:06:05AM +0530, V.Krishn wrote:
> Ok, I was trying to create a cookbook receipe:
> Here are the files that are to be packed:
> receipe.php
> receipe.css
> receipe1.gif
> receipe.gif
> 
> In .php file I use $HTMLHeaderFmt[] to load the .css file.
> 
> What what would be the best method for packing.

I would say that recipe.php should go in cookbook/ , and the
rest of the files should go in pub/recipe/ (perhaps recipe.css
should go into pub/css/ , but there's not much of a standard there).

Alternately, the entire package including the .php file could go 
into pub/recipe/, as long as any .php files are protected or safe 
from direct execution by a browser.

In general, any files that need to be accessible to a browser (such
a .gif images and .css files) belong in pub/ somewhere.

> Now the moot question is "Will this receipe work from both FARM as 
> well as any FIELD"?

It depends -- the interaction of cookbook recipes and farms isn't
entirely defined.  The question is one of whether one thinks that
cookbook recipes can be installed per-field or whether they should
always go into the farm.  (PmWiki itself is purposefully silent on
this issue.)

In general, recipes that need to reference public files should probably
use $PubDirUrl, but also provide an option that allows the admin to
select a different location (e.g., $FarmPubDirUrl) if $PubDirUrl isn't
correct.  Or, perhaps we can provide a variable or method whereby
cookbook recipes can determine if they're farm-based or field-based
and select the correct pub/ location accordingly.

Pm



More information about the pmwiki-users mailing list