01.12.2012 Views

7 Components: the Function Pages - Developers

7 Components: the Function Pages - Developers

7 Components: the Function Pages - Developers

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Parameters<br />

An example<br />

96<br />

��<br />

��<br />

��<br />

creates a link with <strong>the</strong> name “Backlinks” on <strong>the</strong> page that displays<br />

all incoming links (see Chapter 7.1). Note that <strong>the</strong> actual URL is<br />

generated again here.<br />

Especially in <strong>the</strong> case of templates that dictate layout but not content,<br />

it is advantageous to transfer values to <strong>the</strong> template. You can<br />

use your own parameters for this purpose, which can be set when <strong>the</strong><br />

template is accessed. Transfer of values takes place within <strong>the</strong> curly<br />

brackets that surround <strong>the</strong> template, and can be done in two different<br />

ways:<br />

{{Templatename|value1|value2|...}}<br />

{{Templatename|name1=value1| ↵<br />

name2=value2|...}}<br />

In <strong>the</strong> first case, <strong>the</strong> parameters are simply numbered consecutively,<br />

and in <strong>the</strong> second, <strong>the</strong>y can be addressed using a name. The parameters<br />

are integrated in <strong>the</strong> template by setting ei<strong>the</strong>r its number or<br />

name in triple curly brackets. For example:<br />

{{Salu|Ms|Stone}}<br />

{{Salu1|name=Stone|address=Ms}}<br />

Invokes <strong>the</strong> two templates Salu<br />

Hello {{{1}}} {{{2}}}<br />

and Salu1:<br />

Hello {{{address}}} {{{name}}}<br />

The result is <strong>the</strong> same in both cases; <strong>the</strong> sentence “Hello Ms Stone”<br />

appears. The first version is less complicated when writing it, since<br />

you do not need to name <strong>the</strong> parameters. However, if you have a<br />

template with several values, it is simpler to give <strong>the</strong>m names. In<br />

such a case, <strong>the</strong> source text of <strong>the</strong> template is easier to follow. Fur<strong>the</strong>rmore,<br />

<strong>the</strong> order of <strong>the</strong> entries does not matter; thus, you can be<br />

sure that <strong>the</strong> correct information will end up in <strong>the</strong> correct spot. This<br />

advantage should not be underestimated, especially in large-scale<br />

projects!<br />

In <strong>the</strong> following example, we will fur<strong>the</strong>r clarify <strong>the</strong> possibilities<br />

offered by templates by working on <strong>the</strong> design of a uniform participants<br />

page for members of a project group of our tribal initiative.<br />

We want <strong>the</strong> page to have a uniform header with a display of current<br />

6 Multi-Page Structures

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!