Page Queries

ProWiki | RecentChanges | Preferences

Previous: Property Queries

First, let's look at the Page Query. This is a simple syntax that lets you show all of the pages matching some given criteria.

Page Query Syntax

All page queries look more or less like this:

{?query : pattern?}

In this, the query part describes the criteria you're looking for, and the pattern says what to print for each page that matches those criteria.

Simple Page Queries

A simple page query just gives the page names and values for each page that includes that property; if you give a property name as the query and omit the pattern, this is what happens. For example, in the previous page, I showed that IndexName pointed to a special page listing all pages that had the IndexName property. What I didn't mention there was that there is actually nothing very special about that page -- it's simply a small page containing a query! That query looks like this:

{?IndexName?}

And when it is displayed, it shows up like this:

0

You can describe this query as, "For each page that contains the IndexName property, display the IndexName and IndexAbstract? properties on that page, formatted like this". When you display that query, it comes out like this:

Defining New Properties -- This page describes how you can define arbitrary properties on a page.

As you can see, you refer to a property using the syntax %%propname%%. Again, yes, I made it up. Live with it. (Or reimplement using a syntax that suits you better.)

PAGENAME

Each page has an implicit property called PAGENAME. You don't define this explicitly -- it's always there. Notice that the IndexName for the previous page doesn't quite match the actual name of the page. If we wanted to include the real name, we could tweak our query to look like this:

{?IndexName : <b>%%IndexName%%</b> (<i>%%PAGENAME%%</i>) -- %%IndexAbstract?%%<br>?}

When displayed, this comes out as:

Defining New Properties (Defining Properties) -- This page describes how you can define arbitrary properties on a page.

Note that PAGENAME references are always displayed as links.

Next: Property Lists


ProWiki | RecentChanges | Preferences
This page is read-only | View other revisions | View source of this page
Last edited May 19, 2005 5:35 pm by Jducoeur
Search:
Edit: