GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing www.mediawiki.org — Help:Multiple-instance templates - MediaWiki Multiple-instance templates refer to the use of a series of instances of the same (wiki) template on a single wiki page, usually with unique data assigned to each instance. For instance, instances of a template may be used to list the contacts of a company, the ingredients of a recipe, the stories in a book, etc. In this way, you can present items of the same type in a uniform manner and streamline structured data so that they can be stored in the database. The term is typically used in the context of managing such a list of template instances by way of a form (see the form extensions below) as well as itemising data to be stored in the database (see the data storage extensions below). Structurally, multiple-instance templates can be either top-level templates or children of a parent template. A child template is an instance of a template assigned to a parameter of the parent template. A top-level template is not nested in this way and may or may not behave as a parent template for one or multiple child templates. Deeper levels of nesting templates are not impossible, but lack support in form extensions. ExampleThe ingredients of some recipe for salad : {{Recipe
|Title=My favourite salad
|Ingredients={{Ingredient
|Item=Romaine lettuce
|Quantity=Four leaves.
|Preparation=Torn.
}}{{Ingredient
|Item=Radish
|Quantity=Six radishes.
|Preparation=Chopped.
}}{{Ingredient
|Item=Tomato
|Quantity=2 tomatoes.
|Preparation=Chopped.
}}{{Ingredient
|Item=Licame
|Quantity=A small one.
|Preparation=Peeled and julienned.
}}
}}
(etc.) Form extensionsA number of extensions are available that let you use a form to manage template instances more easily.
Data storage extensionsTemplate instances can be used as containers for structured data. The following extensions offer parser functions that can be used in a template to store data:
See also |
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |