Open main menu

Changes

3,905 bytes added ,  09:53, 7 October 2008
New page: == Wiki Template System == See the handbook for details and the Quick Guide {{Search}} Templates are a system for stream...
== Wiki Template System ==
See the [[meta:Help:Template|handbook]] for details and the [[meta:Help:A_quick_guide_to_templates|Quick Guide]]

{{Search}}

Templates are a system for streamlining the data entry and display formatting of article content.

=== Types and Examples ===
==== Presentation and Data Entry ====
A simple example of this is the [[wp:U2|Wikipedia article on the rock band 'U2']]. This article and all Wikipedia articles about musical groups use a "Infobox musical artist" template so authors can record the basics about the musical artist: Band name, discography, genre, albums etc., AND that information can be systematically formatted for display in the article.
==== Functional Templates ====
Templates can also be used to include functionality in a page. An example of this is to mark a page, or link to another application systematically based on either a variable, or a "magic word" like PAGENAME More on MediaWiki variables is at [[meta:Help:Variable]
==== Static Templates ====
Templates can also be used to include static content on a page (kind of like a keyword macro). This is useful when you want to mark a bunch of pages with some common message content, e.g. 'obsolete', '[[:Template:stub|stub]]', 'needs attention' etc.; or perhaps you have a collection of articles that you want to apply a common resource box or navigation to.
=== Using Templates ===
# (optional) create a new page
# insert the template marker in the page content e.g. <nowiki>{{my footer}}</nowiki> would use the 'my footer' template on a page
# (optional) save and re-edit the page as needed to fill out a data entry template

Templates that are data entry templates (having multiple parameters) will have (by convention) a 'noinclude' section found in the template that gives an example which makes it a simple matter of copy and paste to begin using that template.

=== Available Templates ===
See all templates in the [[Special:Prefixindex|prefix index]] (choose the 'Template' namespace in the select box, then press 'Go')

=== See also ===
The "[[transclusion]]" idea is similar (and shares the same basic syntax) allowing you to include other article content by inclusion.

== OpenOffice ==
The [[Open Office]] productivity suite includes a template system so that you can create documents that have a common layout.
* Templates are good to create a uniform look to [[presentation]]s made with OpenOffice Impress.
* [http://documentation.openoffice.org/Samples_Templates/User/template/index.html the documentation project] offers many templates you can add to your default OpenOffice installation. A Google search will reveal many more if you are looking for something in particular.
To use OpenOffice templates in your local system, save the tempate file to your local user template directory. E.g. for Linux users, it would be "/home/<nowiki>[user]</nowiki>/.openoffice.org2/user/template/"

== Programming with Template Systems ==
* [[wp:Template_engine_(web)]]
* [[wp:Web_template_system]]
There are many templating systems in use throughout technology platforms. In fact, any server-side processing technology like PHP offers a built-in notion of templating for separating your display from your business logic and your data using 'includes'. Carried further, there are major templating sub-systems, template libraries, and/or programming frameworks that utilize a particular templating strategy.

=== Smarty ===
For PHP programmers, one of the oldest and well-known template systems (aside from building your own using includes) is the [http://smarty.php.net Smarty] system. For a quick overview, see [[wp:Smarty]] There is also a crash course on the Smarty website in addition to the [http://smarty.php.net/manual/en/ documentation]
=== Drupal ===
Offers a choice of template systems
=== Django ===
Uses the Django Template system

[[Category:Help]]
[[Category:Wiki]]
4,558

edits