[pmwiki-users] Accessing edit fields using cookbook
Patrick R. Michaud
pmichaud at pobox.com
Fri May 11 07:24:13 CDT 2007
On Fri, May 11, 2007 at 02:35:17AM +0530, Vaibhav Vaish wrote:
> I guess I have been vague in my previous question. Let me be more precise:
>
> I have added a new field to the edit form (exactly duplicating the
> recipee edittitle to provide another field with almost similar effect)
> with name "label". I notice that in the raw text file for page (in
> wiki.d/ directory), a new line appears written as "label=value", with
> value I had provided while using the edit
>
> Two questions:
>
> A. How can I access this value in a cookbook recipe?
After reading the page ( using either ReadPage() or RetrieveAuthPage() )
it will be available in the page structure as $page['label'].
> B. (Disjoint from previous one) How do I make a cookbook run on all pages?
Simply load the recipe from the local/config.php file.
Or, if you mean "How do I loop through all pages and apply a
function to each page?", take a look at the ExpireDiff recipe for
an example.
Pm
More information about the pmwiki-users
mailing list