User:Brettz9/test2

From MEpedia, a crowd-sourced encyclopedia of ME and CFS science and history

Intro to DPL[edit | edit source]

The DynamicPageList extension--or rather, our customized version of it which adds support for displaying inline bullets instead of commas--allows us to auto-generate lists of articles within a category.


The code responsible is:

<DynamicPageList>
category  = Body systems
shownamespace = true
mode = inline-bullets
ordermethod = sortkey
order     = ascending
</DynamicPageList>

Our own DPL shortcut[edit | edit source]

If you do not need to tweak the sorting, I have a module in place which accepts a category like this:

{{#invoke:CategoryList|main|Body systems}}

...to produce the same list:


Or:

{{#invoke:CategoryList|pagesInCategory|Body systems}}

...to produce the same (making the (default) function explicit):


Or using this simpler (template) syntax:

{{PagesInCategory|Body systems}}

...to produce the same:


Listing categories[edit | edit source]

Finally, DynamicPageList can (among other things) list categories within categories:


using the following:

<DynamicPageList>
category  = Disease
namespace = Category
shownamespace = false
mode = inline-bullets
ordermethod = sortkey
order     = ascending
</DynamicPageList>

or using the shorter syntax:

{{#invoke:CategoryList|categoriesInCategory|Disease}}

...producing:


or the yet shorter (template-based) syntax:

{{CategoriesInCategory|Disease}}

...to produce the same:


Result[edit | edit source]

However, despite my attempts, I have not been able to built a module which utilizes this (or successfully change DynamicPageList into a "parser function") so that we can recursively go through nested categories to display headings for the main categories, and bulleted lists for the articles at the bottom of the category hierarchy. So, currently, we can add a dynamic list of pages within a category, but we have to designate each category (e.g., on the Main Page) by hand.