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

From DynamicPageList3 Manual
Content added Content deleted
imported>FrozenPlum
m ("alternate example" makes better sense, it's not a true/proper second example, it's a temporary alternative example (that may be removed later))
imported>FrozenPlum
m (similar, not same, not sure what the actual end result should look like, I assume this is it but don't know for sure.)
Line 11: Line 11:


'''Notes:'''
'''Notes:'''
* A <code>format</code> statement could be used to achieve much the same: <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]]).
* 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.
* 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.



Revision as of 03:52, 21 April 2022

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 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 'curid' at the end of the URL, which contains the numeric ID of the page.

This example is currently not working as expected, and may be replaced/changed at a later date.


Notes:

  • A format statement could be used to achieve similar output: |format = ,\n* [²{fullurl:%PAGE%¦curid=%PAGEID%}² %PAGE%] (observed in an 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.
{{#dpl:
|category  = Dessert examples
|showcurid = true
}}

Result

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

Example 2

This selects pages from Category:Dessert examples, the format statement is used to provide very similar functionality to showcurid; the \n* provides a new line and a 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 as an external link, with %PAGE% used again as the link text. Using a magic word (or parser function) in the {{#dpl:}} method of using DPL3 requires special syntax, double curly braces {{ and }} must be replaced with ²{ and respectively, and pipe | characters must be replaced with ¦ or {{!}}. The <span class="plainlinks"></span> wraps each link with a built-in MediaWiki class that can be applied 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%] }}