Advanced Page Queries

ProWiki | RecentChanges | Preferences

Showing revision 2
Previous: Inheritance

Okay -- now that we've laid out the groundwork, let's talk about some of the more advanced features of the query language.

Inheritance Queries

One of the most useful kinds of query is the inheritance query. This is a special kind of page query, that says, "Show me all the pages that descend from this type". An inheritance query looks just like any other page query, except for one major tweak: you put a "~" in front of the query string, to indicate that you are looking for inheritance instead of properties.

For example, let's look at The Incredibly Dippy Subway Game. This contains many characters of different classes -- that is, each character has an IS_A property that points to the character's class. One of those classes is "Loiterers". To list all of the Loiterers in the game, you give this query:

{?~Loiterer : %%Name%% (%%PAGENAME%%)
?}

That is, "For each page that inherits from Loiterer, show me the Name and PAGENAME of that page." It shows up like this:

A bag lady (Bag Lady)
Guy With a Guitar (GuitarGuy)
A skateboard punk (Skateboard Punk)

Combining Query Clauses

 

Nesting Property Lists Inside Page Queries


ProWiki | RecentChanges | Preferences
This page is read-only | View other revisions | View source of this page | View current revision
Edited May 19, 2005 5:58 pm by Jducoeur
Search:
Edit: