[pmwiki-users] Fix for: SearchExtensions broken in beta33

John Rankin john.rankin at affinity.co.nz
Fri May 27 17:44:51 CDT 2005


On Friday, 27 May 2005 2:18 PM, Patrick R. Michaud <pmichaud at pobox.com> wrote:
>On Fri, May 27, 2005 at 01:59:25PM +1200, John Rankin wrote:
>> Now suppose that I want to "Publish-button" the links on the 
>> current page -- generate a report of all the topics associated 
>> with the current page. I need to re-format the main page list 
>> as a form with check boxes, while preserving the side bar format.
>> 
>> It seems a shame to have to create 2 fmtfn functions, when the
>> only difference is the format, which is all controlled in 
>> Fmt variables.
>> 
>> I could pass another parameter through (:linkslist ... :)
>> of course, but this seems a poor solution. Any suggestions?
>
>Actually, I've been thinking that passing a parameter through 
>(:linkslist:) (or pagelist) is probably a good solution.  Consider 
>Cookbook.GlobalOperations -- I've been thinking that the best way 
>to do this sort of thing is to have a "fmt=pagelistform" that 
>formats the list of pages, by whatever selection criteria, into 
>a simple checkbox list that can be easily processed by whatever 
>action is being done.  Thus Cookbook.GlobalOperations becomes:
>
>    (:pagelist fmt=pagelistform action=publish:)
>
>which would generate an HTML form with places to select/deselect
>pages of interest, and results in a posting to ?action=publish.  Or
>something like that.  Then actions on sets of pages can be obtained
>from the resulting form.
>
>If we need to modify MakePageList to be able to generate a list
>of pages linked from a page or set of pages (the opposite of
>backlinks), I'm very open to adding it to the core.
>
>Pm
>
(after a work distraction, back to the real stuff...)

This is interesting and useful. At the moment, I set a variable
called $EnablePublish (true or false). If true, the local config
file sets the various FPL...Fmt variables to start the form,
check-box each page item, add hidden variables for things like
$Needle, $Haystack or $Category, or ..., optionally add a PDF
checkbox, show a Publish button and end the form. In that way,
action=search, action=backlinks and Category pages always offer
a publish button.

Then a publish function deals with the results.

Having an action=publish option would allow this to be
turned on or off more easily. Actually, I don't think one
has to have both fmt=pagelistform and action=publish, as
the existing fmt functions work perfectly well if you just
redefine the FPL...Fmt variables. So why not do it with
just the one action parameter?

That leaves (:linkslist pagename:) which at the moment
lets you write

    (:linkslist some page name:)

and does a MakePageName with $pagename and whatever is the 
text string after 'linkslist', and extracts all the links on
the page. (Strictly, it omits [[~profile]] and [[!category]] 
references, which seems like the right thing to do.)

This is the place where it's particularly useful to turn
publish on and off. I had thought of:

    (:linkslist publish=some page name :)

where 'publish=' is optional. This seems more natural than

    (:linkslist page='some page name' action=publish:)

But I guess I need to re-read the description of the magic
function that extracts directive parameters.

-- 
JR
--
John Rankin






More information about the pmwiki-users mailing list