Jump to: navigation, search

PDMQueryResultLinkFormat

Formatting template originally developed for Template:PDMDocChangeHist but generalizable to other cases where the link for a query result cannot be constructed simply from combinations of Template:PDMQueryResultLinkFormat elements and query fields. For example, you cannot assume that links to Table-* pages can be constructed from the tableName parameter, because some table names might use special characters (such as an ending underscore) that are stripped out of the page's URL.

The template accepts three parameters:

  • pageName — (Required) The Library source page; the third element (i.e., the topic name) is used to replace the equivalent element in the calling page's URL (i.e., in FULLPAGENAME)
  • text — (Required) The link display text
  • format — (Optional) The display format. The default is a bulleted list. Valid values: ul (the default), ol, sub-bullet, newline,inline.
{{#switch:{{{format}}}
|ol=<nowiki/>
# [[{{#replace:{{FULLPAGENAME}}|{{#explode:{{FULLPAGENAME}}|:|3}}|{{#explode:{{{pageName}}}|:|3}}}}|{{#replace:{{{text}}}|_|_<wbr/>}}]]
|sub-bullet=<nowiki/>
** [[{{#replace:{{FULLPAGENAME}}|{{#explode:{{FULLPAGENAME}}|:|3}}|{{#explode:{{{pageName}}}|:|3}}}}|{{#replace:{{{text}}}|_|_<wbr/>}}]]
|newline=<br/>[[{{#replace:{{FULLPAGENAME}}|{{#explode:{{FULLPAGENAME}}|:|3}}|{{#explode:{{{pageName}}}|:|3}}}}|{{#replace:{{{text}}}|_|_<wbr/>}}]]
|inline=[[{{#replace:{{FULLPAGENAME}}|{{#explode:{{FULLPAGENAME}}|:|3}}|{{#explode:{{{pageName}}}|:|3}}}}|{{#replace:{{{text}}}|_|_<wbr/>}}]]
|ul
|#default=<nowiki/>
* [[{{#replace:{{FULLPAGENAME}}|{{#explode:{{FULLPAGENAME}}|:|3}}|{{#explode:{{{pageName}}}|:|3}}}}|{{#replace:{{{text}}}|_|_<wbr/>}}]]
}}


This page was last edited on March 24, 2020, at 17:12.
Comments or questions about this documentation? Contact us for support!