Anonymous user
Examples/Parameter: multisecseparators (example 3): Difference between revisions
Examples/Parameter: multisecseparators (example 3) (view source)
Revision as of 21:44, 11 April 2022
, 2 years agoChanged my mind, this note in the surrogate should be enough.
imported>FrozenPlum m (Add the more via parser function, though put a warning in its surrogate template (since this is for example only and non-ideal use).) |
imported>FrozenPlum m (Changed my mind, this note in the surrogate should be enough.) |
||
Line 7:
This example contains all the same elements as the prior examples, only it uses a [[Template:DPL parameter.surrogateexample|surrogate/phantom template]] to format the second and third column of results. The first column is included in the <code>{{DPL|listseparators}}</code> statement, to prevent the page name from being repeated in every subsequent line. The second column, formatted in the surrogate, has a link constructed to link to the page and parameter name (as the heading/chapter anchor to its matching page heading)<code><nowiki>[[{{{%PAGE%}}}#{{{name}}}|{{{name}}}]]</nowiki></code>. The third column, formatted in the surrogate, uses the #sub [[mw:Help:Extension:ParserFunctions##sub|Parser (string) Function]] <code><nowiki>{{#sub:{{{purpose|}}}|0|50}}</nowiki></code> to shorten the "purpose" parameter value to 50 characters. This is advanced use of a surrogate template in combination with the format statement. For more simple examples of surrogate template use, see the [[Controlling output volume#include contents related to templates|include]] parameter as related to included contents from templates, and for information about tables see also the <code>{{DPL|table}}</code> and <code>{{DPL|tablerow}}</code> parameters.
<pre>
|