[pmwiki-users] BaseName variable [From: Archiving old/obsolete pages]

The Editor editor at fast.st
Fri Sep 22 13:42:30 CDT 2006

Some time ago Pm, you mentioned a possible core change that would
allow for a {$BaseName} for use in Pagelists.  I thought I would
resurrect that idea at this point.

Also if there's a way to set it now in config.php for use in pagelists
I would appreciate a tip on how to do it.  It would have to be
something that would be triggered for each different iteration
returned in the page list.

For ex:  if I wanted to limit search of all my data files in groups
Data-*.*, I would want to define $BaseName in such a way to be able to
put {$BaseName} in a pagelist template and get back links to  *.* for
all the pages it returns.  Ideally, it would only strip the prefix if
it existed.

Thanks for the snippet, or if the reminder helps to get it into core
that's great too.

I don't know how you do it at keeping PmWiki flexible enough to meet
everybody's diverse needs.  But I appreciate it Pm.


Retrieved from the post below:

On 9/2/06, Patrick R. Michaud <pmichaud at pobox.com> wrote:
> On Fri, Sep 01, 2006 at 04:18:12PM -0400, The Editor wrote:
> > Hi all.
> >
> > Your suggestion, Pm, about setting up an archive folder made me wonder
> > how hard it would be to put all the data files the FAST Data recipe
> > creates in a "data" folder.  I currently read protect them but would
> > want admin access to them for fixing/tweaking data as needed.  I would
> > also want them searchable, though it would be PERFECT if the return
> > values were the exact parallel pages in the current wiki folder rather
> > than the ones in the data folder.  Is that possible?  ie:  a hit in
> > data/Test.SomePage would return a link to wiki.d/Test.SomePage.
> What exactly do you mean by a "hit in data/Test.SomePage"?  You mean
> you want pageindex to search the text of data/Test.SomePage
> as well?
> Personally, I wouldn't try doing this with separate folders --
> I'd use specialized pagenames, where the data for Test.SomePage
> goes into Test.SomePage-Data.  Then we can tell the difference
> between data and pages directly from the pagename, rather than
> trying to infer it from its storage location (which non-administrators
> never see anyway).
> It also makes it easy to do searches of only data or non-data pages:
>     (:pagelist name=*-Data:)        # only data pages
>     (:pagelist name=!*-Data:)       # only non-data pages
>     $SearchPatterns['normal'][] = '!-Data$!';   # exclude -Data pages from output
> To link the data page to its parallel, there could be a {$BaseName}
> page variable that converts things like "Test.SomePage-Data" into
> "Test.SomePage" ({$BaseName} is likely to be in the core soon anyway).
> So, it's then possible to do things such as "return me all of the wiki
> pages which have a parallel data page containing the term 'xyz'":
>     (:pagelist name=*-Data 'xyz' fmt=#parallel:)
>     [[#parallel]]
>     * [[{$Group}/{$BaseName}]]
>     [[#parallelend]]
> The pagelist generates a list of "-Data" pages containing 'xyz', the
> fmt=#parallel displays that list with the "-Data" suffix stripped
> from each pagename.
> Pm
> > On 8/30/06, Patrick R. Michaud <pmichaud at pobox.com> wrote:
> > > Another approach might be to have an archive.d/ directory (analogous
> > > to wiki.d/ and wikilib.d/ ) where page files get moved when they're
> > > archived.  Then we simply let pagelist and search skip over archive.d/
> > > when looking up pages.  Everything else then works the same.
> >
> > _______________________________________________
> > pmwiki-users mailing list
> > pmwiki-users at pmichaud.com
> > http://www.pmichaud.com/mailman/listinfo/pmwiki-users
> >

More information about the pmwiki-users mailing list