Jump to content
This wiki has been automatically closed because there have been no edits or log actions made within the last 60 days. If you are a user (who is not the bureaucrat) that wishes for this wiki to be reopened, please request that at Requests for reopening wikis. If this wiki is not reopened within 6 months it may be deleted. Note: If you are a bureaucrat on this wiki, you can go to Special:ManageWiki and uncheck the "Closed" box to reopen it.

Controlling output order: Difference between revisions

m
to match fix for my mistake
imported>FrozenPlum
imported>FrozenPlum
m (to match fix for my mistake)
Line 4:
DPL3 allows you to define the sort order of its output, as is explained below.
 
In some cases, this is not sufficient, however. Think of the following example: You create a list of pages which use a certain template. You want to show the value of the first parameter each page uses when calling that template. This can easily be done with the {{dpl3DPL3|include}} feature of DPL. If you now wanted the output to be sorted by the value of that parameter, DPL could not help because it had to analyze all articles before finding those parameter values.
 
But there is another way: Create a ''sortable wiki table'' (using the {{dpl3DPL3|table}} option of DPL with 'class=sortable') and you can click on the column headings to sort your output accordingly. However, the initial order shown in that table will still be the order in which DPL parsed the wiki pages (usually an alphabetic order of the page names).
 
Using a handful of javascript lines you can sort a wikitable ''on pageLoad'' by any column. You must insert that javascript code AT THE END of your page :
Line 115:
If you use a name for the first time, you should make sure that it is correctly spelt. Otherwise, you will see a SQL error message.
 
For case insensitivity during the ''selection'' of articles, see {{dpl3DPL3|ignorecase}}.
 
==References==
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.