[Pmwiki-users] Publishing a WikiTrail (or a WikiBook)
Mon Aug 4 15:27:44 CDT 2003
> $PublishList = "wiki:$pages[$i] ?";
> Then of course an administrator can redefine $DefaultPageTextFmt if required.
Idea #1: I can do something like this even without the '?' parsing--
basically if none of the pages in "wiki:page1 page2 page3" exist, then
it prints the contents of a $PrintWikiNotFoundFmt variable, and has
some $-substitution set to the name of the last page in the list. By
default $PrintWikiNotFoundFmt would be empty, which would keep the
That works for me! Yes, please. So I just write
$PublishList = "wiki:$pages[$i]";
and set $PrintWikiNotFoundFmt. Cool!
Idea #2: Rather than try to use the wiki: format syntax for this, you
could simply write your own function (say, "PrintPublishList") to
print the pages in the desired sequence and making text substitutions
as required. Then you can use "function:PrintPublishList" instead of
all of the "wiki:..." entries. You could use the PrintWiki function
as a model for a PrintPublishList function (it's short, only 10 or
so lines long I think).
That's sort of what I did, except it's an if statement instead of a function -- I try to use existing pmwiki features wherever possible. You are right, it would be cleaner as a user-defined function. In fact, I would implement it along the lines of Idea #1.
BTW it would be straightforward to Publish the results of a Search function if needed.
Add a [_] Publish checkbox to $SearchTagFmt
If the visitor checks this box, change the search results fmt to include a [_] checkbox on every item and add a Publish button
Publish all checked pages as a single page
I can see this being useful for a search across a DocumentationIndex topic, for example.
More information about the pmwiki-users