Template:Example/doc: Difference between revisions

From DynamicPageList3 Manual
Content added Content deleted
imported>FrozenPlum
m (update the docs to be clearer)
imported>FrozenPlum
m (update docs to match)
Line 2: Line 2:
<!-- Documentation here -->
<!-- Documentation here -->
Creates links to either parameter examples pages, or singular example pages.
Creates links to either parameter examples pages, or singular example pages.
==Usage==
==Example==
* <code><nowiki>{{example|Non-existing page}}</nowiki></code> gives {{example|Non-existing page}}
* <code><nowiki>{{example|category}}</nowiki></code> gives {{example|category}}
* <code><nowiki>{{example|Non-existing page|text label}}</nowiki></code> gives {{example|Non-existing page|text label}}
* <code><nowiki>{{example|category|alt text}}</nowiki></code> gives {{example|category|alt text}}
* <code><nowiki>{{example|category|text label|p=y}}</nowiki></code> gives {{example|category|text label|p=y}} (prepends "Parameter:_" to the URL only, where parameter pages will have multiple examples, plural, on the same page)
* <code><nowiki>{{example|category|text|eg=2}}</nowiki></code> gives {{example|category|text|eg=2}}
* <code><nowiki>{{example|category|p=y}}</nowiki></code> gives {{example|category|p=y}} (prepends "Parameter:_" to the URL only)
* <code><nowiki>{{example|random example|nonparam=any value}}</nowiki></code> gives {{example|random example|nonparam=any value}}
* <code><nowiki>{{example|random example|override text|nonparam=any value|eg=2}}</nowiki></code> gives {{example|random example|override text|nonparam=any value|eg=2}}
<includeonly>
<includeonly>
<!-- Template categories/interwikis here -->
<!-- Template categories/interwikis here -->

Revision as of 23:58, 5 April 2022

This is the documentation page, it should be transcluded into the main template page. See Template:Documentation for more information

Creates links to either parameter examples pages, or singular example pages.

Example

  • {{example|category}} gives Page Template:Example/style.css must have content model "Sanitized CSS" for TemplateStyles (current model is "plain text").
  • {{example|category|alt text}} gives Page Template:Example/style.css must have content model "Sanitized CSS" for TemplateStyles (current model is "plain text").
  • {{example|category|text|eg=2}} gives Page Template:Example/style.css must have content model "Sanitized CSS" for TemplateStyles (current model is "plain text").
  • {{example|random example|nonparam=any value}} gives Page Template:Example/style.css must have content model "Sanitized CSS" for TemplateStyles (current model is "plain text").
  • {{example|random example|override text|nonparam=any value|eg=2}} gives Page Template:Example/style.css must have content model "Sanitized CSS" for TemplateStyles (current model is "plain text").