Issue:Title-attribut sometimes doesn't work with magic words like PAGENAME
Description: | The title attribute doesn't always work well with {{PAGENAME}} or {{#var: foo}} |
Extension / Version: | DPL / 1.8.9 |
Type / Status: | Bug / closed |
Problem
This should return the author of the current Page, but doesn't work. No Feedback whatsoever:
<dpl> title={{PAGENAME}} skipthispage=no addauthor = true mode=userformat format=,,%USER%, noresultsheader=¶No result redirects=include </dpl>
It seems that no Magic word or Parserfunction works in this case, however I have not tested them all.
Live Textcase:
Extension:DynamicPageList (DPL), version 3.2.1: Warning: Skipping bad option 'Issue:Title-attribut sometimes doesn't work with magic words like PAGENAME' for parameter 'title'.
Extension:DynamicPageList (DPL), version 3.2.1: Error: No selection criteria found! You must use at least one of the following parameters: category, namespace, titlematch, linksto, uses, createdby, modifiedby, lastmodifiedby, or their 'not' variants
Extension:DynamicPageList (DPL), version 3.2.1: Warning: No results.
Note: DPL 1.9.0 seems to miss a selection criteria. I thougt title= would do it. However, titlematch wont work either.
However THIS works: (returning number of Page Impressions on the Site)
{{#dpl: | title = {{{1|{{FULLPAGENAME}}}}} | addpagecounter = true | format = ,%COUNT%,, | skipthispage = no | noresultsheader=¶No result }}
Live: %COUNT%
Work around
if you replace
title={{FULLPAGENAME}}
with
titlematch={{PAGENAME}} namespace={{NAMESPACE}}
it works as expected.
Reply
This is not a problem of DPL.
Mediawiki does not expand macros like PAGENAME within TAG-delimited user functions. Therefore DPL cannot "see" the page name and consequently it returns the error "NO SELECTION CRITERIA FOUND".
If you use a parser function call instead of the TAG function everything works fine. BUT, pay attention:
The title command expects a fully qualified title. As the current page is NOT residing in the main namespace one needs to use FULLPAGENAME (this will add the namespace prefix).
So,
{{#dpl: title={{FULLPAGENAME}} | skipthispage=no | addauthor = true | format=,,%USER%, | redirects=include }}
correctly delivers: Trias
--Gero 13:18, 4 December 2009 (UTC)