User:Wonghk3/Sandbox/WikiTextA3

CH-13: TEMPLATES
FOLLOW samples on tutorial page... Templates

DEFINITION of a TEMPLATE
 * a container of FIXED (non-changing) CODE that can be embedded anywhere on a page and onto many pages
 * may be text, tables, images, etc
 * used to standardize page sections
 * some templates allow for us to input 'values' that provide data or links to a page

SHOW EXAMPLES
 * Example of text/table: Aberton Parish
 * Check the breadcrumb trail and Jurisdiction Table


 * Example of image template:

HOW TO CREATE A TEMPLATE 1. Created the same way an ordinary article is created 2. In Search box, type Template:user-defined Template-name 3. Click on Create the page 4. Build template instructions in the edit box, then save page

HOW TO EMBED A TEMPLATE ENTER onto the page without the word Template

HOW TO EDIT A TEMPLATE Click "Edit source" at the top of the page Click Scroll to the bottom of the page and note list of templates Click Locate template of interest, then click on "Edit" CAUTION: Editing a template will change all pages where this template is embedded. Many templates have sub-templates within them which makes following the code difficult

HOW TO EDIT ONLY ONE EMBEDDED TEMPLATE
 * To allow a template to be customized only on one page without changing the other pages using that template
 * When a template is embedded in this manner and one clicks "Edit this Page", they will see all the code used to create the template

ENTER to embed template on that one page

LIMITATIONS The size of a template is defined by the code used IN that template and cannot be adjusted when embedding

CH-14: INFOBOX- CREATING
FOLLOW samples on tutorial page... Templates

WHAT ARE INFOBOXES


 * A specialized table in the form of a display box placed on a page.
 * The box contains quick references about people, locations, organizations, or administrative divisions.

ADVANTAGES OF INFOBOXES


 * ability to add/change info within them w/o editing the template
 * template can be changed on a particular page using "subst:" procedure
 * are coded to be edited only for the page on which they are embedded

CREATING AN INFOBOX WITH RENAMED PARAMETERS


 * Coding includes: open/close Table-tags, rows, and cells
 * the box is floated to the right side of the page using the attribute "float:right" in the Table-tag
 * first two rows use colspan="2" code to combine two columns in the table
 * parameters are added to accept user-input values by placing opening and closing curly brackets in the table: 
 * rename the parameters by ADDING a pipe after the parameter name, then ADDING an explanatory parameter name



SAVING THE INFOBOX template:Name of Society Infobox
 * Save the template using the word infobox in the title

CH-15: INFOBOX - PLACING
FOLLOW samples on tutorial page... Templates

PLACING AN INFOBOX; ADDING PARAMETER VALUES

Abberley Parish, England

CH-16: INFOBOX - IF FUNCTION
FOLLOW samples on tutorial page... Templates