Difference between revisions of "Issue:Title-attribut sometimes doesn't work with magic words like PAGENAME"

From FollowTheScore
Jump to: navigation, search
 
(One intermediate revision by one other user not shown)
Line 4: Line 4:
 
  |Version    = 1.8.9
 
  |Version    = 1.8.9
 
  |Description = The title attribute doesn't always work well with <nowiki>{{PAGENAME}} or {{#var: foo}}</nowiki>
 
  |Description = The title attribute doesn't always work well with <nowiki>{{PAGENAME}} or {{#var: foo}}</nowiki>
  |Status      = open
+
  |Status      = closed
 
}}
 
}}
  
 
== Problem ==
 
== Problem ==
This schould return the author of the current Page, but doesn't work. No Feedback whatsoever:
+
This should return the author of the current Page, but doesn't work. No Feedback whatsoever:
 
<pre><nowiki>
 
<pre><nowiki>
 
<dpl>
 
<dpl>
Line 49: Line 49:
 
| skipthispage = no
 
| skipthispage = no
 
}}
 
}}
 +
== Work around ==
 +
if you replace
 +
<nowiki>title={{FULLPAGENAME}}</nowiki>
 +
with
 +
<nowiki>titlematch={{PAGENAME}}</nowiki>
 +
<nowiki>namespace={{NAMESPACE}}</nowikI>
 +
 +
it works as expected.
  
 
== Reply ==
 
== 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,
 +
<pre><nowiki>
 +
{{#dpl: title={{FULLPAGENAME}} | skipthispage=no | addauthor = true | format=,,%USER%, | redirects=include }}
 +
</nowiki></pre>
 +
 +
correctly delivers: {{#dpl: title={{FULLPAGENAME}} | skipthispage=no | addauthor = true | format=,,%USER%, | redirects=include }}
 +
 +
--[[User:Gero|Gero]] 13:18, 4 December 2009 (UTC)

Latest revision as of 15:18, 4 December 2009

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)