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

m
imported>FrozenPlum
m (Swap to the tempnote template)
imported>FrozenPlum
m (FrozenPlum moved page Controlling output volume/Parameter: showcurid (example 1) to Examples/Parameter: showcurid (example 1): Simplifying how things are structured)
 
(2 intermediate revisions by the same user not shown)
Line 5:
-->__NOTOC__
==Example==
This will outputoutputs a list of pages belonging to [[:Category:Dessert examples]]; the hyperlinks to these pages willwould look normal (displaying their page name), but willwould 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>
Line 20 ⟶ 13:
}}
</pre>
 
'''Notes:'''
* A <code>format</code> statement could also be used to achieve similar(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==
 
{{#dpl:
|category = Dessert examples
Line 29 ⟶ 27:
 
==Example 2==
This selects pages fromin [[:Category:Dessert examples]], the <code>format</code> statement is used to provideprovides very similar functionality to <code>showcurid</code>; the <code>\n* </code> providescreates a new line and awith 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> usedis againthen 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 braces <code><nowiki>{{</nowiki></code> andbraces <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.
 
<pre>
Line 43 ⟶ 41:
|format = ,\n* <span class="plainlinks">[²{fullurl:%PAGE%¦curid=%PAGEID%}² %PAGE%]</span>
}}
 
<noinclude>
[[Category:ControllingAdding outputmeta volumedata (examples)‎to the output‎]]
[[Category:Uses category parameter]]
[[Category:Uses showcurid parameter]]
Anonymous user