Examples/Parameter: showcurid (example 1): Difference between revisions

From DynamicPageList3 Manual
Content added Content deleted
imported>FrozenPlum
No edit summary
imported>FrozenPlum
m (Minor adjustments to text)
Line 5: Line 5:
-->__NOTOC__
-->__NOTOC__
==Example==
==Example==
This outputs a list of pages belonging to [[:Category:Dessert examples]]; the hyperlinks to these pages would look normal (displaying their page name), but would use an additional MediaWiki parameter named '[[mw:Manual:Parameters to index.php#Page revision or version|curid]]' at the end of the URL, which contains the numeric ID of the page.

This will output a list of pages belonging to [[:Category:Dessert examples]]; the hyperlinks to these pages will look normal (displaying their page name), but will use an additional MediaWiki parameter named '[[mw:Manual:Parameters to index.php#Page revision or version|curid]]' at the end of the URL, which contains the numeric ID of the page.
{{tempnote}}


'''Notes:'''
* A <code>format</code> statement could be used to achieve similar output: <code>|format = ,\n* <span class="plainlinks">[²{fullurl:%PAGE%¦curid=%PAGEID%}² %PAGE%]</span></code> (observed in an [[Controlling output volume/Parameter: showcurid (example 1)#Example 2|alternate example]]).
* Using this type of link may be somewhat faster than using the title only. This kind of link is useful for some web spiders (e.g., some search engine spiders may need a unique ID within the pagelink) and it works even if the title has moved.


<pre>
<pre>
Line 20: Line 13:
}}
}}
</pre>
</pre>

'''Notes:'''
* A <code>format</code> statement could also be used to achieve (working) output: <code>|format = ,\n* <span class="plainlinks">[²{fullurl:%PAGE%¦curid=%PAGEID%}² %PAGE%]</span></code> (observed in an [[Controlling output volume/Parameter: showcurid (example 1)#Example 2|alternate example]]).
* <code>showcurid=true</code> cannot be used together with <code>openreferences=true</code>.
* Using this type of link may be somewhat faster than using the title only. This kind of link is useful for some web spiders (e.g., some search engine spiders may need a unique ID within the pagelink) and it works even if the title has moved.
{{tempnote}}


==Result==
==Result==

{{#dpl:
{{#dpl:
|category = Dessert examples
|category = Dessert examples
Line 29: Line 27:


==Example 2==
==Example 2==
This selects pages from [[:Category:Dessert examples]], the <code>format</code> statement is used to provide very similar functionality to <code>showcurid</code>; the <code>\n* </code> provides a new line and a bullet, then the MediaWiki [[mw:Help:Magic words|magic word]] <code><nowiki>{{fullurl:}}</nowiki></code> is used to create the URL from <code>%PAGE%</code>, and feed the URL the <code>%PAGEID%</code> as a URL parameter as an external link, with <code>%PAGE%</code> used again as the link text. Using a magic word (or parser function) in the <code><nowiki>{{#dpl:}}</nowiki></code> method of using DPL3 requires special syntax, double curly braces <code><nowiki>{{</nowiki></code> and <code><nowiki>}}</nowiki></code> must be replaced with <code><nowiki>²{</nowiki></code> and <code><nowiki>}²</nowiki></code> respectively, and pipe <code>|</code> characters must be replaced with <code><nowiki>¦</nowiki></code> or <code><nowiki>{{!}}</nowiki></code>. The <code><nowiki><span class="plainlinks"></span></nowiki></code> wraps each link with a built-in [[mw:Manual:Plainlinks|MediaWiki class]] that can be applied to prevent the external link icon from displaying.
This selects pages in [[:Category:Dessert examples]], <code>format</code> provides very similar functionality to <code>showcurid</code>; the <code>\n* </code> creates a new line with bullet, then the MediaWiki [[mw:Help:Magic words|magic word]] <code><nowiki>{{fullurl:}}</nowiki></code> is used to create the URL from <code>%PAGE%</code>, and feed the URL the <code>%PAGEID%</code> as a URL parameter external link. <code>%PAGE%</code> is then used as the link text. Using a magic word (or parser function) in the <code><nowiki>{{#dpl:}}</nowiki></code> method of using DPL3 requires special syntax, double curly <code><nowiki>{{</nowiki></code> braces <code><nowiki>}}</nowiki></code> must be replaced with <code><nowiki>²{</nowiki></code> and <code><nowiki>}²</nowiki></code> respectively, and pipe <code>|</code> characters must be replaced with <code><nowiki>¦</nowiki></code> or <code><nowiki>{{!}}</nowiki></code>. The <code><nowiki><span class="plainlinks"></span></nowiki></code> wraps each link with a [[mw:Manual:Plainlinks|MediaWiki class]] to prevent the external link icon from displaying.


<pre>
<pre>
Line 43: Line 41:
|format = ,\n* <span class="plainlinks">[²{fullurl:%PAGE%¦curid=%PAGEID%}² %PAGE%]</span>
|format = ,\n* <span class="plainlinks">[²{fullurl:%PAGE%¦curid=%PAGEID%}² %PAGE%]</span>
}}
}}

<noinclude>
<noinclude>
[[Category:Adding meta data to the output‎]]
[[Category:Adding meta data to the output‎]]

Revision as of 23:04, 16 January 2023

Please do not edit this page unless you're wanting to edit the manual itself, it is an example included in the manual.

Example

This outputs a list of pages belonging to Category:Dessert examples; the hyperlinks to these pages would look normal (displaying their page name), but would use an additional MediaWiki parameter named 'curid' at the end of the URL, which contains the numeric ID of the page.

{{#dpl:
|category  = Dessert examples
|showcurid = true
}}

Notes:

  • A format statement could also be used to achieve (working) output: |format = ,\n* [²{fullurl:%PAGE%¦curid=%PAGEID%}² %PAGE%] (observed in an alternate example).
  • showcurid=true cannot be used together with openreferences=true.
  • Using this type of link may be somewhat faster than using the title only. This kind of link is useful for some web spiders (e.g., some search engine spiders may need a unique ID within the pagelink) and it works even if the title has moved.
This example is currently non-working, it may be replaced or removed at a later date to improve the clarity of this manual. As this needs to be done at a deliberate pace, the Gamepedia DPL3 Manual can be used in the interim, keeping in mind some functions may have changed.

Result

{{#dpl: |category = Dessert examples |showcurid = true }}

Example 2

This selects pages in Category:Dessert examples, format provides very similar functionality to showcurid; the \n* creates a new line with bullet, then the MediaWiki magic word {{fullurl:}} is used to create the URL from %PAGE%, and feed the URL the %PAGEID% as a URL parameter external link. %PAGE% is then used as the link text. Using a magic word (or parser function) in the {{#dpl:}} method of using DPL3 requires special syntax, double curly {{ braces }} must be replaced with ²{ and respectively, and pipe | characters must be replaced with ¦ or {{!}}. The <span class="plainlinks"></span> wraps each link with a MediaWiki class to prevent the external link icon from displaying.

{{#dpl:
|category  = Dessert examples
|format = ,\n* <span class="plainlinks">[²{fullurl:%PAGE%¦curid=%PAGEID%}² %PAGE%]</span>
}}

Result 2

{{#dpl: |category = Dessert examples |format = ,\n* [²{fullurl:%PAGE%¦curid=%PAGEID%}² %PAGE%] }}