DPL3
Basic Syntax:
To create a dynamic page list in DPL3, you need to wrap the DPL query inside <dpl></dpl> tags. The basic syntax looks like this:
<dpl> category=Dying Light 2 category=Texture </dpl>
This query will return all pages that are categorized under both Dying Light 2 and Texture.
AND Operator (Multiple Lines):
Each line of a DPL query represents a separate condition that must be satisfied simultaneously (AND operation). For example:
<dpl> category=Dying Light 2 category=Texture namespace=Main </dpl>
This query will return all pages that:
- Belong to the Dying Light 2 category
- Belong to the Texture category
- Are in the Main namespace
The result will only include pages that meet all these conditions.
OR Operator (Pipe |):
To specify an "OR" condition, you use the pipe symbol (|). Pages that meet any of the conditions will be included in the results. For example:
<dpl> category=Dying Light 2 | category=Dying Light 1 </dpl>
This query will return pages that:
- Belong to either the Dying Light 2 category or the Dying Light 1 category.
In this case, pages from either of the two categories will be returned.
Combining AND and OR:
You can combine both AND and OR operators in the same query by using multiple lines and pipe symbols. Here’s an example:
<dpl> category=Dying Light 2 category=Texture | category=Material namespace=Main </dpl>
This query will return pages that:
- Belong to the Dying Light 2 category
- Belong to either the Texture or the Material category
- Are in the Main namespace
Additional Parameters:
In addition to category, DPL3 allows you to filter pages based on other parameters:
namespace: Filters pages by namespace (e.g., Main, User, Talk, etc.). limit: Sets a limit on the number of results to return (e.g., limit=10 will return a maximum of 10 pages). title: Filters by the title of the pages (e.g., title=Dying Light* will match all pages starting with "Dying Light"). include: Includes specific pages (e.g., include=Page1, Page2). exclude: Excludes specific pages (e.g., exclude=Page3).
For example:
<dpl> category=Dying Light 2 category=Texture namespace=Main limit=5 </dpl>
Sorting Results:
You can also sort the results by various criteria. Use the order by parameter to specify the sorting order:
<dpl> category=Dying Light 2 category=Texture order by=title </dpl>
This will sort the pages alphabetically by title.
You can also use:
- order by=timestamp to sort by the last modification date.
- order by=category to sort by category.
To reverse the sort order, use reverse=1:
<dpl> category=Dying Light 2 order by=title reverse=1 </dpl>