Changes

Jump to: navigation, search

Advanced Wiki Use

107 bytes added, 14:16, 30 April 2010
no edit summary
Here are some advanced MediaWiki features:
 
= Namespaces =
** The ''CDOT'' category page would show ''CDOT Workstations'' as a subcategory.
* You can place category tags in templates
* Categories have their own, distinct namespace
= Transclusion and Templates =
* Transclusion is pulling text into a page from another page (line <code>#include</code> in C++)
* Basic syntax: <code><nowiki>{{</nowiki>''Template''<nowiki>}}</nowiki></code>
* By default, transclusion will pull in pages from the Template namespace. Alternately, a namespace may be specified.
* There are two tags available to control what text is transcluded:
** <code><nowiki><includeonly>''text''</includeonly></nowiki></code> - The text applies only when transcluded. This is useful when you want to include a Category tag in a template, and you don't want the template itself to appear in the category index.
** <code><nowiki><noinclude>''text''</noinclude></nowiki></code> - The text appears only when not transcluded. This is useful for including explanatory text on the actual template page, or when you have a page that may be viewed directly as well transcluded. For example, a page of upcoming lists could include introductory text as well as a bullet list of upcoming events; tagging the introductory text <code><nowiki><noinclude></nowiki></code> will allow just the bullet list to be transcluded.
* Templates may accept arguments; these arguments may then be used within the template as text, filenames, pagenames, or for some other syntax. Arguments In the template, arguments are accessed using triple braces and the argument number: <code><nowiki>{{{1}}}</nowiki></code>. In the transclusion reference, arguments are delimited with the vertical-bar (pipe) character. Example: <code><nowiki>{{Admon/note|Unstable API!|This API is marked Unstable, and may change without warning. If you use this API, be prepared to revise your code frequently.}}</nowiki></code> -- which produces:
{{Admon/note|Unstable API!|This API is marked Unstable, and may change without warning. If you use this API, be prepared to revise your code frequently.}}

Navigation menu