On 2/13/06, jdd <[EMAIL PROTECTED]> wrote:
> I'm having a bad time with template writing :-(.

They can be a bit tricky, but when used properly quite timesaving, I
especially like them for table creation, like the HCL tables.

> * to explain simply how it do (mediawiki doc is very
> difficult to follow)
> * to list the relevant images, should be nice to use the
> same images on most <langages> - seems we don't have a "common"?
> * to list the used templates and they content. for now the
> only way I find is to go to "all pages" and ask for
> templates, then open them one after one, not very handy.

Most of the message templates I created I have stuck on
http://en.opensuse.org/Templates
with an example, a link to the template and a guide on how to use.

It shouldn't be too hard to simply copy and translate templates.

The basics of a template is quite easy.

I will step through how I created Template:User which is is a better
way to list a user as it will give a link to the users contributions
and their talk page.

I decide that the template will need one variable, the user's name,
and that you would use it like:

{{User|Pflodo}}

I start by creating a new Wiki page called Template:User and I add the
contents as thus:

[[User:{{{1}}}|{{{1}}}]] - ([[User_talk:{{{1}}}|Talk]])
([[Special:Contributions/{{{1}}}|Contributions]])

That's a lot of brackets, but if you replace all the {{{1}}} with the
value of the first variable in our example usage (in our case the only
variable) you get:

[[User:Pflodo|Pflodo]] - ([[User_talk:Pflodo|Talk]])
([[Special:Contributions/Pflodo|Contributions]])

If we had more than one variable the second would be inserted with
{{{2}}}, there is also named variables, but walk before you run.

Now the benefit of Templates should be clear to all, as we can now for
example update the Template:User template and the change will appear
on all pages where it is used.

The formatting of the template is the same as any other page including
images etc, except that you have to use some imagination as the
contents is replaced by the variables.


Peter 'Pflodo' Flodin

Reply via email to