Department of Electrical and Computer Engineering Facebook page


  • DEPARTMENT
    • Overview
    • Computing
    • Facilities
    • Organizations
    • Educational Objectives
    • Student Outcomes
    • Scholarship Awards
    • Employment
    • Advisory Committee
    • Contact
  • ACADEMICS
    • Undergraduate
      • Computer Eng.
      • Electrical Eng.
      • Ambassadors
    • Graduate
      • Information for Prospective Students
      • ECE Graduate Handbook
      • Graduate Forms
      • Ph.D. Qualifying Exam
      • Distance Education
      • Frequently Asked Questions (FAQ)
    • Courses
    • Student Survival kit
    • Distance Learning
  • PEOPLE
    • Faculty
    • Staff
  • PROSPECTIVE STUDENTS
    • Overview
    • FAQ
    • Considering ECE
    • Scholarships
    • PC Requirements
    • Office of Admissions
  • RESEARCH
    • Overview
    • Signal Processing & Communications
    • Digital Systems & Microelectronics
    • Power & High Voltage
    • Research Centers
      • Emerging Materials Research Laboratory
      • High Voltage Laboratory
      • Robotics
    • HPCC
  • ALUMNI
Template:Template creation and usage - Ece
Personal tools
  • Log in
Views
  • Template
  • Discussion
  • View source
  • History

Template:Template creation and usage

From Ece

Jump to: navigation, search

See the template creation and usage page for more information on templates.

This page gives documentation on how to create and use Wiki templates. The text above this paragraph is the text included in a Wiki page when that page uses this template.

Contents

  • 1 Usage
    • 1.1 Advanced usage
  • 2 Templates
    • 2.1 Creation and usage
    • 2.2 Editing
    • 2.3 Parameters
    • 2.4 Documentation

Usage

To use this template, place the text {{Template creation and usage}} in your Wiki template. For example: {{Template creation and usage}} produces the following sentence: See the template creation and usage page for more information on templates.

All templates should include this template to provide potential authors with a starting point for template documentation, preferably after the first sentence of the template's documentation. As an example of usage and placement, consider the text of the DigiKeyPart template:

[http://www.digikey.com/scripts/DkSearch/dksus.dll?PName?Name={{{1}}}&Site=US Digi-Key {{{1}}}]<noinclude>

This template provides a link to a specific part on the Digi-Key web site, given the part number. {{Template creation and usage}}

== Usage ==
Within a wiki page, place the fragment <code><nowiki>{{DigiKeyPart|part_num}} to place a link to part_num on the Digi-Key web site. For example:
{{DigiKeyPart|QRD1114-ND}}</nowiki></code> produces {{DigiKeyPart|QRD1114-ND}}.

</noinclude>

Advanced usage

To suppress inclusion of the [[Category:Templates]] tag discussed in the the documentation section, use the syntax {{Template creation and usage|nocategory}}. The intended use of this feature is on the Category:Templates page, where inclusion of the [[Category:Templates]] tag creates an (unwanted, in this case) subcategory tag (see subcategories).

Templates

A template (termed a transclusion) is a simple macro facility for Wiki pages. See the full documentation or a quick start guide for more detailed information.

Creation and usage

To create a template, simply create a new Wiki page preceded by Template:; for example, this template page is titled Template:Template creation and usage. To use a template in a Wiki page, enclose the template's name in double curly braces; the usage section above gives an example.

Editing

When editing a template, the "Show preview" button can be used to see changes made in the documentation to a template; however, the text actually included by the template (even if used in the documentation section) will not be updated until the "Save page" button is clicked. Therefore, when editing before the <noinclude> tag, always click "Save page" to see the results of your edit; clicking "Show preview" will, as a preview, show the results of the last saved template, not the preview you're seeing.

When editing a Wiki page which includes a template, all templates used on that page will be listed just below the Save page, Show preview, and Show changes buttons.

Parameters

In a template, {{{1}}} references the first parameter passed, {{{2}}} the second parameter, and so on. To pass parameters to a template, separate them by vertical bars: {{DemoTemplate|hello|world}} in a Wiki page means that in the (nonexistent) Template:DemoTemplate, {{{1}}} is hello and {{{2}}} is world. As a second example, {{DigiKeyPart|QRD1114-ND}} references the DigiKeyPart template, which takes one parameter (here, QRD1114-ND) and produces a link to the Digi-Key web site page for that part: Digi-Key QRD1114-ND. More sophisticated usage is also possible.

Documentation

To document a template, surround your template's documentation with the <noinclude> and </noinclude> tags. Inclusion of this template automatically adds the statement [[Category:Templates]] to enable Wiki authors to easily obtain a list of templates. Place the <noinclude> tag immediately after the end of your template text, not on the next line. Placing the template on the next line means that the extra newline is included as part of the template, which can make paragraphs break unexpectedly. For example, this template begins with the code

See the [[Template:Template creation and usage|template creation and usage page]]...<noinclude>

This page gives documentation...

Therefore, this template can be included using {{Template creation and usage}} which produces the following sentence: See the template creation and usage page for more information on templates. The paragraph continues after this template inclusion. As a counterexample, if the <noinclude> tag is incorrectly placed, as in the Incorrect template noinclude placement template, the resulting sentence causes an unexpected paragraph break: The incorrect template noinclude placement page injects an unwanted newline by placing the <noinclude> tag on the line after the template text.

This sentence is therefore incorrectly placed in a new paragraph.


Retrieved from "http://www.ece.msstate.edu/wiki/index.php/Template:Template_creation_and_usage"
Category: Templates
Navigation
  • Main Page
  • Community portal
  • Current events
  • Recent changes
  • Random page
  • Help
SEARCH
TOOLBOX
LANGUAGES
 
Toolbox
  • What links here
  • Related changes
  • Upload file
  • Special pages
  • Printable version
  • Permanent link
Powered by MediaWiki
  • This page was last modified on 19 March 2007, at 21:37.
  • This page has been accessed 4,004 times.
  • Privacy policy
  • About Ece
  • Disclaimers

Mississippi State University Home| PO Box 9571, Mississippi State, MS 39762 | Main Office: 1.662.325.3912

Bagley College of Engineering | Mississippi State University| Legal| Webmaster| Intranet

Page modified: Tue, 23 Sep 2008 15:18:39 CDT