Jump to content
This wiki has been automatically closed because there have been no edits or log actions made within the last 60 days. If you are a user (who is not the bureaucrat) that wishes for this wiki to be reopened, please request that at Requests for reopening wikis. If this wiki is not reopened within 6 months it may be deleted. Note: If you are a bureaucrat on this wiki, you can go to Special:ManageWiki and uncheck the "Closed" box to reopen it.

Examples/Parameter: multisecseparators (example 3): Difference between revisions

m
tweak link text
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 (tweak link text)
 
(6 intermediate revisions by the same user not shown)
Line 6:
==Example==
 
This example contains all the same elements as the prior examples, only it uses a [[Template:DPL parameter.surrogateexample|surrogate/ (also known as 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 and third column, formatted in the surrogate, hascreates a link constructed to link to the page and's parameter name (assection, theand heading/chapterthen anchordisplay tothe its"purpose" matchingtext pageusing heading)<code><nowiki>[[{{{%PAGE%}}}#{{{name}}}mw:Help:Extension:ParserFunctions|{{{name}}}Parser Functions]]</nowiki></code>. TheThis thirdcombination column,of formattedformatting the page name in thea "separators" format statement '''and''' a surrogate template, usesresults thein #subtemplates [[mw:Help:Extension:ParserFunctions##sub|Parserused (string)multiple Function]]times <code><nowiki>{{#sub:{{{purpose|}}}|0|50}}</nowiki></code>on a page to shortenbe theseparated "purpose"into parameterseparate valuetable torows 50under characters.the Thisparent ispage advancedname use(normally ofrepeat atemplates surrogateused templateon ina combinationpage withare thecombined formatinto statementa single row). ForThis example is advanced, for more, simple examples of surrogate template use, see the [[Controlling output volume#include contents related to templates|include examples]] parameter as related to includedincluding contents from templates, and for information about tables see also the <code>{{DPL|table}}</code> and <code>{{DPL|tablerow}}</code> parameters for straightforward table examples.
{{note|This example's surrogate template requires that <code>[[mw:Extension:ParserFunctions|$wgPFEnableStringFunctions]]</code> be set to "true" (enabled) in order to function correctly; on Miraheze, this is a setting that can be found and enabled in [[meta:ManageWiki|ManageWiki]].}}
 
<pre>
Line 13 ⟶ 12:
|category = Primary Module
|nottitlematch = %volume%¦%page selection%
|uses = Template:DPL Parameter
|include = {dpl manual}:,{DPL parameter}.surrogateexample
|mode = userformat
|listseparators = ¶{¦class="wikitable sortable" ¶!colspan=3¦Includes a surrogate (phantom) template¶¦-¶!Page ¶!Name ¶!Purpose,¶¦-¶¦[[%PAGE%]]¶,¶¦-¶¦class="dpl-dark-background" colspan=3¦,¶¦}
|secseparators = ,¶¦class="dpl-orange-background"¦,
|multisecseparators = ,¶¦-¶¦¶¦class="dpl-blue-background"¦
Line 26 ⟶ 25:
|category = Primary Module
|nottitlematch = %volume%¦%page selection%
|uses = Template:DPL Parameter
|include = {dpl manual}:,{DPL parameter}.surrogateexample
|mode = userformat
|listseparators = ¶{¦class="wikitable sortable" ¶!colspan=3¦Includes a surrogate (phantom) template¶¦-¶!Page ¶!Name ¶!Purpose,¶¦-¶¦[[%PAGE%]]¶,¶¦-¶¦class="dpl-dark-background" colspan=3¦,¶¦}
|secseparators = ,¶¦class="dpl-orange-background"¦,
|multisecseparators = ,¶¦-¶¦¶¦class="dpl-blue-background"¦
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.