Difference between revisions of "Test distinct"
Roc michael (talk | contribs) |
|||
(7 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
+ | __TOC__ | ||
<tt>[[distinct]]</tt> test: | <tt>[[distinct]]</tt> test: | ||
Line 5: | Line 6: | ||
* [[distinct test]] (various links to this page) | * [[distinct test]] (various links to this page) | ||
− | |||
{{#dpl: | {{#dpl: | ||
linksto={{PAGENAME}}{{!}}{{PAGENAME}}s{{!}}{{PAGENAME}}es{{!}}{{PAGENAME}}ies{{!}}{{PAGENAME}}ing{{!}}{{PAGENAME}}ed{{#if:{{{2}}}|{{!}}{{{2}}}{{!}}{{{2}}}s|}}{{#if:{{{3|}}}|{{!}}{{{3}}}{{!}}{{{3}}}s|}} | linksto={{PAGENAME}}{{!}}{{PAGENAME}}s{{!}}{{PAGENAME}}es{{!}}{{PAGENAME}}ies{{!}}{{PAGENAME}}ing{{!}}{{PAGENAME}}ed{{#if:{{{2}}}|{{!}}{{{2}}}{{!}}{{{2}}}s|}}{{#if:{{{3|}}}|{{!}}{{{3}}}{{!}}{{{3}}}s|}} | ||
Line 11: | Line 11: | ||
}} | }} | ||
+ | === Code === | ||
+ | <pre>{{#dpl: | ||
+ | linksto={{PAGENAME}}{{!}}{{PAGENAME}}s{{!}}{{PAGENAME}}es{{!}}{{PAGENAME}}ies{{!}}{{PAGENAME}}ing{{!}}{{PAGENAME}}ed{{#if:{{{2}}}|{{!}}{{{2}}}{{!}}{{{2}}}s|}}{{#if:{{{3|}}}|{{!}}{{{3}}}{{!}}{{{3}}}s|}} | ||
+ | |resultsheader=<h2>Backlinks (%PAGES%)</h2> | ||
+ | }} | ||
+ | </pre> | ||
+ | ===Description=== | ||
+ | The reason why this query shows several entries for ''distinct test'' is that the uniqueness requirement refers to the <u>combination of referring page and referred page</u>. Note that a referring page might contain several references to the same page (which you wouldn´t want to see in the listing). DPL offers a variable named %PAGESEL% which shows the referring page. If we add that variable to the example we see why there are several occurencies of ''distinct test'' in the output: | ||
+ | {{#dpl: | ||
+ | linksto={{PAGENAME}}{{!}}{{PAGENAME}}s{{!}}{{PAGENAME}}es{{!}}{{PAGENAME}}ies{{!}}{{PAGENAME}}ing{{!}}{{PAGENAME}}ed{{#if:{{{2}}}|{{!}}{{{2}}}{{!}}{{{2}}}s|}}{{#if:{{{3|}}}|{{!}}{{{3}}}{{!}}{{{3}}}s|}} | ||
+ | |resultsheader=<h2>Backlinks (%PAGES%)</h2> | ||
+ | |format=,\n*[[%PAGE%{{!}}%TITLE%]] referenced by %PAGESEL%, | ||
+ | }} | ||
+ | === Code === | ||
+ | <pre>{{#dpl: | ||
+ | linksto={{PAGENAME}}{{!}}{{PAGENAME}}s{{!}}{{PAGENAME}}es{{!}}{{PAGENAME}}ies{{!}}{{PAGENAME}}ing{{!}}{{PAGENAME}}ed{{#if:{{{2}}}|{{!}}{{{2}}}{{!}}{{{2}}}s|}}{{#if:{{{3|}}}|{{!}}{{{3}}}{{!}}{{{3}}}s|}} | ||
+ | |resultsheader=<h2>Backlinks (%PAGES%)</h2> | ||
+ | |format=,\n*[[%PAGE%{{!}}%TITLE%]] referenced by %PAGESEL%, | ||
+ | }} | ||
+ | </pre> | ||
---- | ---- | ||
− | + | If we set distinct=strict we will only get one result. Note that the value of %PAGESEL% in this case will be not useful. | |
− | |||
− | |||
{{#dpl: | {{#dpl: | ||
linksto={{PAGENAME}}{{!}}{{PAGENAME}}s{{!}}{{PAGENAME}}es{{!}}{{PAGENAME}}ies{{!}}{{PAGENAME}}ing{{!}}{{PAGENAME}}ed{{#if:{{{2}}}|{{!}}{{{2}}}{{!}}{{{2}}}s|}}{{#if:{{{3|}}}|{{!}}{{{3}}}{{!}}{{{3}}}s|}} | linksto={{PAGENAME}}{{!}}{{PAGENAME}}s{{!}}{{PAGENAME}}es{{!}}{{PAGENAME}}ies{{!}}{{PAGENAME}}ing{{!}}{{PAGENAME}}ed{{#if:{{{2}}}|{{!}}{{{2}}}{{!}}{{{2}}}s|}}{{#if:{{{3|}}}|{{!}}{{{3}}}{{!}}{{{3}}}s|}} | ||
|resultsheader=<h2>Backlinks (%PAGES%)</h2> | |resultsheader=<h2>Backlinks (%PAGES%)</h2> | ||
− | |format=,\n*[[%PAGE%{{!}}%TITLE%]] referenced by [[% | + | |format=,\n*[[%PAGE%{{!}}%TITLE%]] referenced by %PAGESEL%, |
+ | |distinct=strict | ||
+ | }} | ||
+ | === Code === | ||
+ | <pre>{{#dpl: | ||
+ | linksto={{PAGENAME}}{{!}}{{PAGENAME}}s{{!}}{{PAGENAME}}es{{!}}{{PAGENAME}}ies{{!}}{{PAGENAME}}ing{{!}}{{PAGENAME}}ed{{#if:{{{2}}}|{{!}}{{{2}}}{{!}}{{{2}}}s|}}{{#if:{{{3|}}}|{{!}}{{{3}}}{{!}}{{{3}}}s|}} | ||
+ | |resultsheader=<h2>Backlinks (%PAGES%)</h2> | ||
+ | |format=,\n*[[%PAGE%{{!}}%TITLE%]] referenced by %PAGESEL%, | ||
+ | |distinct=strict | ||
}} | }} | ||
+ | </pre> |
Latest revision as of 03:31, 9 September 2007
Contents
distinct test:
- Test distinct (link to this page via {{PAGENAME}})
- test distinct (link to this page)
- distinct test (various links to this page)
Extension:DynamicPageList (DPL), version 3.2.1: Warning: Skipping bad option 'Test distinct|Test distincts|Test distinctes|Test distincties|Test distincting|Test distincted|{{{2}}}|{{{2}}}s' for parameter 'linksto'.
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.
Code
{{#dpl: linksto={{PAGENAME}}{{!}}{{PAGENAME}}s{{!}}{{PAGENAME}}es{{!}}{{PAGENAME}}ies{{!}}{{PAGENAME}}ing{{!}}{{PAGENAME}}ed{{#if:{{{2}}}|{{!}}{{{2}}}{{!}}{{{2}}}s|}}{{#if:{{{3|}}}|{{!}}{{{3}}}{{!}}{{{3}}}s|}} |resultsheader=<h2>Backlinks (%PAGES%)</h2> }}
Description
The reason why this query shows several entries for distinct test is that the uniqueness requirement refers to the combination of referring page and referred page. Note that a referring page might contain several references to the same page (which you wouldn´t want to see in the listing). DPL offers a variable named %PAGESEL% which shows the referring page. If we add that variable to the example we see why there are several occurencies of distinct test in the output:
Extension:DynamicPageList (DPL), version 3.2.1: Warning: Skipping bad option 'Test distinct|Test distincts|Test distinctes|Test distincties|Test distincting|Test distincted|{{{2}}}|{{{2}}}s' for parameter 'linksto'.
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.
Code
{{#dpl: linksto={{PAGENAME}}{{!}}{{PAGENAME}}s{{!}}{{PAGENAME}}es{{!}}{{PAGENAME}}ies{{!}}{{PAGENAME}}ing{{!}}{{PAGENAME}}ed{{#if:{{{2}}}|{{!}}{{{2}}}{{!}}{{{2}}}s|}}{{#if:{{{3|}}}|{{!}}{{{3}}}{{!}}{{{3}}}s|}} |resultsheader=<h2>Backlinks (%PAGES%)</h2> |format=,\n*[[%PAGE%{{!}}%TITLE%]] referenced by %PAGESEL%, }}
If we set distinct=strict we will only get one result. Note that the value of %PAGESEL% in this case will be not useful.
Extension:DynamicPageList (DPL), version 3.2.1: Warning: Skipping bad option 'Test distinct|Test distincts|Test distinctes|Test distincties|Test distincting|Test distincted|{{{2}}}|{{{2}}}s' for parameter 'linksto'.
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.
Code
{{#dpl: linksto={{PAGENAME}}{{!}}{{PAGENAME}}s{{!}}{{PAGENAME}}es{{!}}{{PAGENAME}}ies{{!}}{{PAGENAME}}ing{{!}}{{PAGENAME}}ed{{#if:{{{2}}}|{{!}}{{{2}}}{{!}}{{{2}}}s|}}{{#if:{{{3|}}}|{{!}}{{{3}}}{{!}}{{{3}}}s|}} |resultsheader=<h2>Backlinks (%PAGES%)</h2> |format=,\n*[[%PAGE%{{!}}%TITLE%]] referenced by %PAGESEL%, |distinct=strict }}