Difference between revisions of "DPL Example 004"

From FollowTheScore
Jump to: navigation, search
(New page: {{Example|Create a sortable table of articles based on template parameters, use phantom temlate with subquery}} We produce a table where the reference link to the article is not in the fi...)
 
 
(4 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{Example|Create a sortable table of articles based on template parameters, use phantom temlate with subquery}}
+
{{Example|Create a sortable table of articles based on template parameters, use phantom template with subquery}}
 +
 
 +
As we want full control over the fields and formats of each row we use a phantom template (surrogate template).
  
 
We produce a table where the reference link to the article is not in the first column.
 
We produce a table where the reference link to the article is not in the first column.
We show a column which contains inbound links to the resp. article.
+
 
 +
We generate a column which contains inbound links to the resp. article. We could do anything within the phantom template.
  
 
<pre><nowiki>
 
<pre><nowiki>
Line 8: Line 11:
 
  |category=Fictitious country
 
  |category=Fictitious country
 
  |include={Country}.phantom-004
 
  |include={Country}.phantom-004
  |table=class=sortable,-,Name,Country,Capital,Articles linking to that country
+
  |table=class="wikitable sortable",-,Name,Country,Capital,Articles linking to that country
 
}}
 
}}
 
</nowiki></pre>
 
</nowiki></pre>
Line 19: Line 22:
 
  |category=Fictitious country
 
  |category=Fictitious country
 
  |include={Country}.phantom-004
 
  |include={Country}.phantom-004
  |table=class=sortable,-,Name,Country,Capital,Articles linking to that country
+
  |table=class="wikitable sortable",-,Name,Country,Capital,Articles linking to that country
 
}}
 
}}

Latest revision as of 20:44, 22 August 2012

back to list of examples

Create a sortable table of articles based on template parameters, use phantom template with subquery

As we want full control over the fields and formats of each row we use a phantom template (surrogate template).

We produce a table where the reference link to the article is not in the first column.

We generate a column which contains inbound links to the resp. article. We could do anything within the phantom template.

{{#dpl:
 |category=Fictitious country
 |include={Country}.phantom-004
 |table=class="wikitable sortable",-,Name,Country,Capital,Articles linking to that country
}}

The above DPL command produces the following output:


Name Country Capital Articles linking to that country
Name? DPL Example 007 main page 1 Capital?
Republic of Nigunda Nigunda Bamitogoo
Republic of Nigunda Test Nigunda Test Bamitogoo Test
Somango Island Somango Aaaabququque