Mailing List Archive

Templates - not understanding a concept
Hello, all.

I have a question about templates. I understand that they are excellent for
building things that one might wish to repeat on many pages, so having the
template saves a lot of extra work. Not only that, if you need to update the
content, you need only update the template, and the changes show up everywhere.
That part I get, but here is what I'm wondering:

If I had a page structure that I wanted people to use, would that be
appropriately done with a template? For example, if I had a few sections, like
"Description", "Requirements", "Download" etc., would it make sense to build a
template with those pre-built as section headings? Could I then create custom
stubs and include them in the template? The custom stub would be like "Add the
product description here, blah, blah, blah."

I have this in mind because there will be a lot of pages that we want to look
exactly alike, save for the actual content. How could I set this up so that they
use the template to start a new page from scratch?

Hmm...lots of questions in this one. Thank you in advance for your assistance in
clarifying my understanding of templates.

Craig Hartel
http://codex.wordpress.org/
Re: Templates - not understanding a concept [ In reply to ]
Technically speaking, you could do it. However, it would be awkward.

In FIRSTwiki (www.firstwiki.org), each of the teams have a page (eg,
[[FIRSTwiki:1]][[FIRSTwiki:1238]] [[FIRSTwiki:1227]]). Most of the
pages are the same, but a few early ones don't. We could use a
template to handle this, but it would be difficult to manage and edit.
(I suggested using one for the table, since that is a better
canidate).

So, basically, yes you could, but you may not want to.

On Tue, 14 Sep 2004 15:22:06 -0700, Craig Hartel <craig@nuclearmoose.com> wrote:
> Hello, all.
>
> I have a question about templates. I understand that they are excellent for
> building things that one might wish to repeat on many pages, so having the
> template saves a lot of extra work. Not only that, if you need to update the
> content, you need only update the template, and the changes show up everywhere.
> That part I get, but here is what I'm wondering:
>
> If I had a page structure that I wanted people to use, would that be
> appropriately done with a template? For example, if I had a few sections, like
> "Description", "Requirements", "Download" etc., would it make sense to build a
> template with those pre-built as section headings? Could I then create custom
> stubs and include them in the template? The custom stub would be like "Add the
> product description here, blah, blah, blah."
>
> I have this in mind because there will be a lot of pages that we want to look
> exactly alike, save for the actual content. How could I set this up so that they
> use the template to start a new page from scratch?
>
> Hmm...lots of questions in this one. Thank you in advance for your assistance in
> clarifying my understanding of templates.
>
> Craig Hartel
> http://codex.wordpress.org/
>
>
>
> _______________________________________________
> MediaWiki-l mailing list
> MediaWiki-l@Wikimedia.org
> http://mail.wikipedia.org/mailman/listinfo/mediawiki-l
>
>
>
>
>



--
-------------------------------------------------------------------
http://endeavour.zapto.org/astro73/
Thank you to JosephM for inviting me to GMail!
Re: Templates - not understanding a concept [ In reply to ]
On Tue, 14 Sep 2004 15:22:06 -0700, Craig Hartel <craig@nuclearmoose.com> wrote:
> Hello, all.
> If I had a page structure that I wanted people to use, would that be
> appropriately done with a template? For example, if I had a few sections, like
> "Description", "Requirements", "Download" etc., would it make sense to build a
> template with those pre-built as section headings? Could I then create custom
> stubs and include them in the template? The custom stub would be like "Add the
> product description here, blah, blah, blah."

This is essentially a different kind of template, I think. Several
people have requested the ability to use such templates, but they are,
in a sense, backwards to what is currently available: they call for an
outline of a page, which can be filled and modified on an individual
basis, but acts as a guideline.

The closest you could currently get would be a template containing the
headers, with each paragraph forming a parameter. However, you
wouldn't then be able to deviate from the template when you wanted to,
which would be annoying. The upside is you could rearrange the headers
in the template, and it would change the order in all the pages using
it.

However, there is no "default parameter" system as yet, so your "add a
such-and-such here" texts wouldn't be possible. Your users would also
have to add in the {{foo | para1=this ... }} manually, so they might
as well just type the headings themselves! The best you can do with
the current version of MediaWiki would seem to be have an example page
somewhere, and tell them to copy and paste it into their new article.
Then you can have the headings, dummy paragraphs, and everything, and
they don't even need to understand the markup.

--
Rowan Collins BSc
[IMSoP]
Re: Templates - not understanding a concept [ In reply to ]
Thanks for your replies; it's much appreciated!

Craig.
RE: Templates - not understanding a concept [ In reply to ]
If I understand what you are asking for, you can use the substitution ("subst") syntax with a template.

For example, lets says you have Template:foo with the outline you talked about. When you create a new article, you can put {{subst:foo}} in the edit box and press Show Preview. This will display the content of Template:foo at the top, but still show "{{subst:foo}}" in the edit box (but only temporarily, until you save). You can either
- save, and then re-edit the article and customize the text (although this creates one extra edit, no big deal) or
- copy the text from the previewed text into the edit box (which only works if there is no formatting, as that will be lost).

This is more fully explained in the template help:
http://meta.wikimedia.org/wiki/Help:Template#subst

Michael Richards

-----Original Message-----
From: mediawiki-l-bounces@Wikimedia.org
[mailto:mediawiki-l-bounces@Wikimedia.org]On Behalf Of Craig Hartel
Sent: Tuesday, September 14, 2004 6:22 PM
To: MediaWiki announcements and site admin list
Subject: [Mediawiki-l] Templates - not understanding a concept

Hello, all.

I have a question about templates. I understand that they are excellent for
building things that one might wish to repeat on many pages, so having the
template saves a lot of extra work. Not only that, if you need to update the
content, you need only update the template, and the changes show up everywhere.
That part I get, but here is what I'm wondering:

If I had a page structure that I wanted people to use, would that be
appropriately done with a template? For example, if I had a few sections, like
"Description", "Requirements", "Download" etc., would it make sense to build a
template with those pre-built as section headings? Could I then create custom
stubs and include them in the template? The custom stub would be like "Add the
product description here, blah, blah, blah."

I have this in mind because there will be a lot of pages that we want to look
exactly alike, save for the actual content. How could I set this up so that they
use the template to start a new page from scratch?

Hmm...lots of questions in this one. Thank you in advance for your assistance in
clarifying my understanding of templates.

Craig Hartel
http://codex.wordpress.org/
Re: Templates - not understanding a concept [ In reply to ]
Richards,Michael wrote:
> If I understand what you are asking for, you can use the substitution ("subst") syntax with a template.
>
> For example, lets says you have Template:foo with the outline you talked about. When you create a new article, you can put {{subst:foo}} in the edit box and press Show Preview. This will display the content of Template:foo at the top, but still show "{{subst:foo}}" in the edit box (but only temporarily, until you save). You can either
> - save, and then re-edit the article and customize the text (although this creates one extra edit, no big deal) or
> - copy the text from the previewed text into the edit box (which only works if there is no formatting, as that will be lost).
>
> This is more fully explained in the template help:
> http://meta.wikimedia.org/wiki/Help:Template#subst
>
> Michael Richards
>

Michael,

Your input is much appreciated! I will follow the supplied link and read up on this.

Thank you for your help.

Craig.