W3TPL/recipes

Listing Pages in a Category
This bit is for a feature-in-development. I'll probably be adding full SQL capability at some point, but I want to make sure it is secure (and can be disabled in LocalSettings) before putting it in; for now, W3 is going to have data access only by filtering tables -- which can also be data views, i.e. potentially very complex SQL but only if you have db permission to create views.

SQL
CREATE OR REPLACE VIEW qryW3_Titles_Catgs AS SELECT * FROM categorylinks AS cl LEFT JOIN page AS p ON cl_from=page_id;
 * Very similar to the dpl_clview view used by DPL

Wikitext
   

    
 * : " ":
 * Replace "Data/target" with the name of the category you want to list
 * Alter the line which begins with (i.e. everything between the  tags) to display what you want; "title" and "source" are from an actual live installation (PsyCrit) and are defined within the pages in that category, so each output line gives a little information about the page (effectively a mini-"report")
 * The "including" variable tells the included pages not to show their category, so that this page won't think it is also in that same category.

To use the same data to generate a form with a drop-down list of all titles returned:  

      - <call xmltag contents="/OPTION" /> <call xmltag contents="/SELECT" /> <call xmltag contents="/form" />