[pmwiki-users] 404 Not Found

H. Fox haganfox at users.sourceforge.net
Thu Jan 26 17:02:59 CST 2006


On 1/26/06, Patrick R. Michaud <pmichaud at pobox.com> wrote:
> On Thu, Jan 26, 2006 at 02:36:24PM -0700, H. Fox wrote:
> > On 1/26/06, Waylan Limberg <waylan at gmail.com> wrote:
> > > I'd say all my thoughts are pretty well covered and I'd say Hagan sums
> > > it up all nicely.
> >
> > The crux of it is conditional markup for testing if a group exists.
> >
> >     (:if [a group with this name exists]:)
> >
> > Is it possible, Pm?  If not, can it be made possible?
>
> I was thinking about exactly this item when I woke up this morning --
> with the new wildcard handler in place I'm thinking we can have
> an (:if exists <pagename>:) conditional that also understands
> wildcards:
>
>     (:if exists Group.SomePage:)    -- true if Group.SomePage exists

The following accomplishes that::

   $Conditions['exists'] = "PageExists(\$condparm)";

it seems to work.  (Found here:
http://article.gmane.org/gmane.comp.web.wiki.pmwiki.user/15945 )

For PageNotFound, searching for {$Group}RecentChanges might work if
blank RecentChanges pages for the three default groups were bundled in
the distribution.

>     (:if exists Group.* :)          -- true if any pages in Group
>
> The first test is very fast, because it can look immediately for
> a known pagename.  The wildcard version will often be a fair bit
> slower because it requires scanning all of the page directories...
> but at least it would work.  Besides, this would normally be done
> only for missing pages, which is fairly rare anyway.

It sounds like it would work well.  It's configurable, so an
administrator can change it if desired.

Hagan




More information about the pmwiki-users mailing list