Help talk:Template

From Meta

Jump to: navigation, search

Archives:

Contents

[edit] Complete rewrite

I think few would dispute that the current version of the Help:Template page is horrifically cluttered, poorly laid out and structured, repetitive, out-of-date and overly technical, among many other faults. I have completed a first draft of a complete rewrite which can be found at User:Happy-melon/Template. I am interested to hear what other editors think of the version and whether it would make a suitable replacement for the existing page. Please feel free to contribute to the discussion on the talk page. Happymelon 19:48, 25 January 2008 (UTC)

I don't think so. Meta-wiki provides documentations which can be used by any wikimedian or, in general, anybody who uses the mediawiki engine. This page is the most up-to-date of its kind. Its cook-book and reference manual style together with the examples illustrating the technical details are very useful and important for practioners; There are introductory pages such as Help:A_quick_guide_to_templates which may help a new editor learn. Hillgentleman 18:22, 29 January 2008 (UTC)
I agree fully with Happy melon. I have attempted to dumb down this page, liberally using <ref> tags to move unnecessary techno babble to the foot notes. Odessaukrain 16:56, 4 April 2008 (UTC)
Trying to learn about templates, I find that there are too many template-help pages that are poorly structured. I have read quite a few pages until I found this one. Searching for template usually brings up material on template messages; perhaps someone can review the whole set of related pages, I would be grateful. Vigilius 16:42, 15 April 2008 (UTC)
One specific point: Trying to understand how parameters are used, the explanation is strange. I understand triple braces, but I frequently find {{{1|}}} and so far fail to understand this. The example under "Parameter mechanism": "A parameter tag such as {{{3|stu}}} can both be referenced explicitly with e.g. 3=pqr, or implicitly by putting pqr in the third position among the unnamed parameter definitions. If the name is not a "small" positive integer it can only be referenced explicitly." is very strange. Using pipe is suddenly introduced without explanation, and the relation between stu and pqr - neither of which is mentioned before on the page - is not explained. Please help and rewrite this! (Postscript: I just found Help:Parameter_default - which helps some, but is not linked from the current article page. Vigilius 16:42, 15 April 2008 (UTC)
It was already linked, but I added another link and some clarification.--Patrick (talk) 01:14, 17 April 2008 (UTC)

[edit] Merger

To say that Help:Template is written badly would be giving Help:Template too much credit. That is why I added the merge tags at Help:Template and User:Happy-melon/Templates. For years I have wondered and searched for how to add formal tags. Several times I have attempted to read Help:Template and have always gone away confused because of the technobabble.

I started to painfully rewrite this page today, putting the worst technobabble in footnotes. Then I started to read the much better written User:Happy-melon/Templates and I will completely abandon this page. Odessaukrain 17:10, 4 April 2008 (UTC)

I looked up w:Technobabble, which confirmed that the term is not applicable at all.--Patrick (talk) 22:50, 6 April 2008 (UTC)
If you want introductions you can find help:a quick guide to templates or you may ask somebody. The page is a reference manual for all (not just for beginners); As we know, reference manuals often appear to be terse to beginners and yet they are necessarily so in order to provide information on most forseeable situations. Hillgentleman 01:14, 17 April 2008 (UTC)
  • You are welcome to write supplementary help pages on aspects of the template mechanism, and put links to them from the main page.
  • If you really want to restructure it, I would suggest refactor the pages in the w:wikipedia:Summary Style, moving the finer points to subpages and keeping an accessible overall structure. However, it may make it more difficult for users from other wikis to copy-and-paste from this meta page.Hillgentleman 01:23, 17 April 2008 (UTC)

Please merge these too pages, I immediatly understood most of the happy-melon version while i didnt understand the other one, sorry, and i'm not even a beginner, I use a wiki for the charity I support and I also use wikis an awful lot at work grts,Pinq 18:04, 24 April 2008 (UTC)

Again, It would be a good thing to restructure the content. We may move more content to help:advanced templates or even add a new page such as help:advanced 1/2 templates. However, simply merging the two pages may actually lead to confusion. Hillgentleman 20:07, 24 April 2008 (UTC)

That sounds reasonable Hillgentleman, I think that would be a good solution. grts,Pinq 17:46, 25 April 2008 (UTC)

In that case we should outline what material should be included in each of the pages. It is reasonable to expect that the page named help:template would be the first port of call of anybody. So it should at least serve to: 1. explain clearly what templates are so that everybody can understand; 2. provide direction to more details. We can be flexible in naming the subpages and in the style of presentations. Hillgentleman 00:06, 29 April 2008 (UTC)
  • I am going to start a new section at the bottom of this talk page: #Refactor? Hillgentleman 00:08, 29 April 2008 (UTC)

[edit] Counting templates

Is there a way to count the number of times that a particular template is used within a single article? I have a template that is used multiple times within an article. The very first time I would like it to render a special help icon/link. All future times I would like it to not render it. I suppose I would need to store a count in the article page itself and increment the state within the template. However, I am unsure how to store article state. Any ideas? Two separate templates could be used as a workaround, but I would prefer to avoid this. Thanks. 202.221.192.193 05:30, 7 February 2008 (UTC)

You would need something like mw:Extension:VariablesExtension. Without that, you still don't need two separate templates, but you would need to mark the first template call yourself by a parameter.--Patrick (talk) 15:54, 7 February 2008 (UTC)

[edit] Monitoring Parameter Usage

Did something change? I was doing this up until recently, and today I clicked on the same link, but it doesn't show any usage. This it the page that has all of the links to monitor the usage. I already checked the templates, and none have changed in any way that should have affected the usage monitoring. The only thing I can think of is the new preprocessor, but the example page still works. Could someone help figure this out? Thanks, MrKIA11 (talk) 21:35, 10 February 2008 (UTC)

Yes, it is probably the new preprocessor. It is not yet activated on Meta.--Patrick (talk) 09:25, 11 February 2008 (UTC)
You can use w:template:voidd ( talk edit history links ) instead.--Patrick (talk) 09:49, 11 February 2008 (UTC)
Thanks, MrKIA11 (talk) 12:05, 11 February 2008 (UTC)

[edit] Expansion at load time?

The page states that templates are expanded at page load time. Is that really true? I mean, wouldn’t it be far better to flag all templates which are not time-dependent and for all articles save a version of the wikitext with all those templates expanded until the next revision? Otherwise, is there a way to have the wikitext saved without substing? --Quilbert 03:57, 21 February 2008 (UTC)

Actually, caching is done, I added a note. I don't know the details, such as whether the expanded wikitext is cached, or the html. May be there are caching mechanisms on various levels.--Patrick (talk) 10:51, 21 February 2008 (UTC)

[edit] Redlinks?

Nearly every other link at http://en.wikipedia.org/wiki/Help:Template is red. Is some effort being made to correct this problem? 71.182.185.125 16:16, 24 February 2008 (UTC)

[edit] Finding existing templates

How can one list what templates exist? Should they be listed under "Specialpages"? It seems that one could create a category specifically for the purpose and then make sure to define in each template that it then belongs to the category, but this relies on each template creator knowing that this needs to happen and that they remember to do it. If one doesn't know that a template exists, there's every chance that multiple editors will create different templates to produce the same result. 213.131.238.25 17:08, 11 March 2008 (UTC)

You can go to Special:Prefixindex. Type nothing in the "Display pages with prefix" box, select Template in the Namespace box, and click Go. The entries in italics are redirects. Libcub 19:37, 11 March 2008 (UTC)

[edit] Template Categories

I have lots of templates in my wiki, some boilerplate, some parameterized, and I have placed these templates into categories for the sole purpose of being able to easily find all templates in a particular category. The problem is, the category page lists not only the templates, but also every page that uses those templates, which can be pretty much all of them. The clutter renders this approach unusable.

Is there a way I can use categories to show only templates? or must I manually keep a wiki page up to date with links to the actual templates? 60.240.122.215 06:31, 28 March 2008 (UTC)

Instead of [[Category:Something]] apply <noinclude>[[Category:Something]]</noinclude> (don't put an enter before it becuse it would appear in the article where template is used). Bináris 10:23, 28 March 2008 (UTC)

[edit] Internal Wiki-Link in a template

I am attempting to make a template of a standard design. In this design i have various parameters and each is good enough on its own. But some of the parameters i am currently having to type out the linke code i.e. |location=[[something:elswhere]] where as i would like to just type |location=elsewhere.

Below is what i would like to happen but cant.
A Template example:
page name = Template:something

{|
|{{{name}}}
|[[something:{{{location}}}|]]
|}

Page input:

{{something
|name=their
|location=elsewhere
}}

Basic results of the template filled in from input:

{|
|their
|[[something:elsewhere]]
|}

Thanx for your time,
John Wood
LOTRO Wiki
02:35, 1 April 2008 (UTC)

You cannot use the "pipe trick", but you can simply write out the piped link: [[something:{{{location}}}|{{{location}}}]].--Patrick (talk) 06:51, 1 April 2008 (UTC)


[edit] Example moved to talk page

I move the example on this page here:

A page with:
{{t1demo|{{ta}}|{{tb}}|{{tc}}={{td}}|1={{te}}|2={{tf}}}}, with {{tim|t1demo}}
only using parameter {{{1}}}, and giving start-start-pqr-end-end,
displays templates tc and te only.

This example needs to be better written, I replaced it with a very simple example. I know the above example has many more tricks, but it is almost impossible to decipher, and many of the pages it links to "ta" "tb" have been redirected. Odessaukrain 16:58, 4 April 2008 (UTC)

[edit] Refactor?

We have seen some opinions expressed that this page is hard to read. It is true that this page is a little long. I don't think we should dilute or remove any of its content, but refactoring the page in w:wikipedia:summary style may help everybody in either learning template functionalities or in looking up particular details. In particular, we may move some of the contents to more specific subpage. What do people think? Hillgentleman 00:15, 29 April 2008 (UTC)

[edit] Ambiguity of Magic Words?

I have a template A that contains {{B}} and a template B that contains {{REVISIONTIMESTAMP}}. I want a page that includes A to display the time B was edited. Instead it displays when A was edited. Is there a way to make this work?

Revisiontimestamp provides information for the page you are viewing. For your purpose, you may try {{last edit}}.Hillgentleman 02:59, 9 June 2008 (UTC)

[edit] Need to restructure pages related to template writing

I understand the need for both a reference manual and various types of user guide pages, as mentionine din the discussion of a proposed merge (above). But the current structure is hopeless: Help:Template is the first page editors are offered if they use the standard Wikipedia Help facility, but is as user-friendly as the proverbial cornered rat.(2) Most "programmers" learning a new "language" start with a tutorial or guide, then cheat sheets, and only look at reference manuals when they have enough experience to handle the allusiveness (often circular) and terseness of the typical reference manual.(1) I therefore suggest that:

  • Help:Template should be moved to a new page, e.g. Template/Reference Manual.
  • Help:Template should become a portal page that gives access to: the reference manual; a guide / tutorial; a set of cheat sheets. I expect that the user guide and cheat sheets will need to be spit over multiple pages. I also suspect that the reference manual should also be split, so that clarity does not need to be sacrificed in order to keep the page length within reasonable limits.

(1) I'm a retired computer consultant; I've taught myself several languages, taught a few, and written more documentation than I care to remember.
(2) A common expression among Information technology professionals. Philcha 13:20, 24 June 2008 (UTC)

Restructuring is good. Hillgentleman 07:55, 30 June 2008 (UTC)

[edit] single level categorisation

I have a template that I use (eg. Template:Monster). The template (amongst other things) contains <includeonly>[[Category: {{{variable}}}]]</includeonly>, where {{{variable}}} is based upon parameters passed to it. I then use Template:Monster in my Goblin article, and Goblin is then nicely categorised. All good so far.

The problem is with my Monsters article which includes (amongst many others) the Goblin article. The Monsters article is therefore placed into every category that any of my monster articles (that use Template:Monster) are in.

How can I avoid this? Is there a way to tell an article not to be in a category? Ideally, I would be able to include <noinclude>[[Category: {{{variable}}}]]</noinclude> in Template:Monster so that while Goblin was categorised, it wouldn't get passed down the line to Monsters.

Help please? 60.240.122.215 05:18, 30 June 2008 (UTC)

We may try to noinclude around the template on goblin or use {{#if...|[[category:...]]|}} on template:monster. It depends on what you are doing. Hillgentleman 08:06, 30 June 2008 (UTC)
Essentially, the whole article of Goblin is generated by Template:Monster, so I can't use <noinclude>{{Monster|...}}</noinclude> in Goblin, because then it wouldn't appear in the Monsters article. The template could provide many categories, and is partly it's purpose, so moving that functionality out of the template and into each article, such as Goblin, doesn't work for me either. 60.240.122.215 23:23, 30 June 2008 (UTC)
Can you provide some links to the pages you are talking about? Hillgentleman 23:48, 30 June 2008 (UTC)
The wiki is private, so no can do there, but following are 3 sample pages to indicate the exact type of thing I've got going on to better illustrate. There's much more, of course, to each of these pages in my wiki, but this should be enough.
Template:Monster
{{#foreach:Cat$n$|[[Category:{{ucfirst:{{{Cat$n$}}}}} Monster Category]]}}
Goblin
{{Monster|Name=Goblin|Description=yada yada|Cat1=Humanoid|Cat2=Intelligent}}
Monsters
{{:Goblin}}<br>{{:Kobold}}<br>{{:Minotaur}}<br>etc.
Hopefully, that gives you a better idea of my structure. The problem is that the Monsters article is also getting categorised into Category:Humanoid Monster Category, Category:Intelligent Monster Category, etc. whereas only Goblin, Kobold, etc. are supposed to be. And of course, every monster will have varying categories. 60.240.122.215 05:38, 1 July 2008 (UTC)
I haven't played with loop functions. But from what I can see, in Template:Monster, could you replace [[Category:{{ucfirst:{{{Cat$n$}}}}} Monster Category]] with something like {{#ifeq:{{PAGENAME}}|{{{Name|}}}|[[Category:{{ucfirst:{{{Cat$n$}}}}} Monster Category]]|}} ? Hillgentleman 17:01, 1 July 2008 (UTC)
That's worked well. I had to add case insensitivity by using {{#ifeq:{{uc:{{PAGENAME}}}}|{{uc:{{{Name|}}}}}|.... Awesome. Thanks for your help. 60.240.122.215 23:23, 1 July 2008 (UTC)

[edit] Handling this help page

I've just rediscovered my work at User:Happy-melon/Templates, and it's prompted me to want to sort this page and Help:Advanced templates out once and for all. I think what we should be looking to do is, first of all, write a completely comprehensive but non-repetitive replacement for Help:Template, probably working on User:Happy-melon/Templates. Then that should probably be transwikied over mw:Help:Templates leaving m:Help:Template either as a soft redirect or a clone. The technobabble involving configuration, parser-order, etc, should probably then be split out of that to mw:Manual:Templates, but that's another job.

So to get things moving, I'd like to deal with the criticism that has been raised about User:Happy-melon/Templates leaving out information that is currently buried somewhere in this current help page. I would very much appreciate any specific examples. I know, for instance, that the fact that the parser strips hashes from template names is not documented; is there anything else? Happymelon 21:25, 30 June 2008 (UTC)

It strikes me that the majority of useless junk on this help page is not, per se, completely useless. It just consists of 'tips and tricks' to use with templates. That's not what this page should be about. So what I think I want to do is move this page to something like Help:Template tricks, and make Help:Templates just be the raw functionality of template code (ie, User:Happy-melon/Templates). Comments? Happymelon 16:42, 1 July 2008 (UTC)
Personal tools