Dynamic Page Lists
Introduction Pages[edit]
- Architecture and Content Pages
- Categories
- Content Templates
- Create a New User Account
- Formatting Templates
- Frequently Asked Questions
- Governance
- New Editor Resources
- Page Types
- Sandbox
- Sign Up For an Introductory Workshop
- Social Contract
- Style Guide
- Style Guide Warnings
- The Big Picture
- The Credit Box
- Theory of Knowledge
- Video Tutorials
- Welcome to Salish Sea Restoration
- Wiki Markup Tutorial
See Technical Pages
Also see Content Templates for pre-fab page lists or Cargo Queries for more sophisticated searching.
There are over 1000 pages on the wiki describing workgroups and their efforts and products, places and topics. Any editor can use Categories to retrieve and sort automated lists of pages using two functions: Dynamic Page Lists and Category Trees. A Dynamic Page List requires a set of selection criteria that determine what pages are retrieved. This typically uses categories, namespaces, or data on the edit history. You can also select pages by authorship, links, or content search, and can constrain the number of pages retrieved, and present the pages in different ways. This page gives you a brief introduction to the use of DPL, however the capabilities can become quite advanced for power users. Category Trees let you show branches of our Categories both with or without associated pages. Users with knowledge of SQL (Structured Query Language) can go further by using Cargo Queries
DPL Parameters[edit]
Full Dynamic Page List instructions currently live on at The Fandom Wiki
Page Selection[edit]
- category=Name or notcategory=Name - if you want the page to have all categories you must use multiple category criteria. If you want any page with any of several categories (an "OR" function) you can separate category names using the "|" symbol.
- namespace=Main,File,Category,Template,User - this is useful for advanced users that want to discriminiate the kind of page based on the page type. Most pages on the wiki are in the namespace "Main" however other namespaces are used for files, categories and templates. The default namespace is always "Main".
- uses=Template:Name or notuses=Template:Name - particularly useful for creating a list of places bese on their primary page time (rather than category), which is always indicated using a template.
- titlematch=word% - the % symbol is used as a wild card, such that this will find all pages where the title begins with "word".
- linksto=pagename - you can use "magic words" such as {{FULLPAGENAME}} to refer to the current page. The value can use % as a wildcard. You can also use notlinksto, linksfrom, etc.
- Modifiedby=username - to limited the search to pages created or modified by specific users.
Output Formatting[edit]
- resultsheader=text at beginning of list - You can
- count=5 - You can limit the number of pages returned to the initial number of a list, and so sort method and order then become critical for which pages are returned
- ordermethod=title,titlewithoutnamespace,size,firstedit,lastedit, - you can deliver pages in an order defined by several parameters, here are some obvious examples.
- order=ascending, descending - whether from first to last, or from last to first.
- mode=unordered, ordered, inline, category - Defines the output, numbered lists are ordered, while bulleted lists are unordered. in-line delivers the list as in-line text separated by dashes. You can use bullets by using the inlinetext parameter below.
- inlinetext=& nbsp; & bull; & nbsp; - for inline text, all spaces at the ends are stripped out. Adding this string makes the list nicely spaced with pages separated by pretty bullets consistent with our Platform Style Guide.
- distinct=true - used when a query may identify select than one instance of a page meeting a parameter, and you only want a list of distinct pages.
- shownamespace=false - we use this when querying over multiple namespaces (such as documents that are both off-site in the main namespace, and on-site in the file namespace, but where you don't want to include the namespace, so you can put them all together, perhaps in alphabetical order.
You can also have a DPL query deliver lists in columns by using various Formatting Templates
This is just an introduction, and this function is much more powerful than you might imagine. You can also use PHP regular expressions to find content using the parameter includematch=regex search string
. Here are links to more advanced instructions:
DPL Code Samples[edit]
This query provides a bulleted list:
<DPL>
category=Place
category=South Puget Sound|Whidbey Basin
ordermethod=titlewithoutnamespace
order=ascending
mode=unordered
</DPL>
This query provides a list of links in-line separated by bullets (you need to remove the space after the & to activate the code):
<DPL>
category=Place
category=South Puget Sound|Whidbey Basin
ordermethod=titlewithoutnamespace
order=ascending
mode=inline
inlinetext= & nbsp; & bull; & nbsp;
</DPL>
This query would return the first five pages in aphabetical order that have both the Place category, and either the South Puget Sound or Whidbey Basin categories. Notice that within the <DPL> invocation, all query parameters use the same format: "paramter=value". So to use DPL you need to know the various parameters and values you can use.
Category Tree Code Samples[edit]
<categorytree mode=categories showcount=on depth=1 hideroot=on>Scale</categorytree> <categorytree mode=pages category=product showcount=on depth=3 hideroot=on>Anthropogenic Topics</categorytree>