Help talk:Template

Collapsed State
On in the Ghost Rider: Travels on the Healing Road, I added "state=collapsed" in the Rush template on the page as it takes up a lot of space when it's visible. It didn't work. Other times, it has work when editing other articles with templates. It doesn't make sense to work sometimes and not work other times. Never inquired about this before. Need to know what to do for next time. Mr. C.C. Hey yo!I didn't do it! 00:14, 10 November 2023 (UTC)

Help
Does anyone have a full list of templates? im trying to see how many i can fit into my user page and im not sure if the template index has all of them (and i also want to find some templates that are in Help pages Whenthecat (talk) 18:18, 26 January 2024 (UTC)
 * There isn't a technically complete list of templates, because what makes something a template is in the minds of its users. But essentially all templates are in the Template namespace and essentially all pages in the Template namespace are templates, so you can use Special:AllPages.  Database reports/Page count by namespace says there are about 375,000 of them.
 * I don't know what you mean by templates in help pages.
 * (For the sake of clarity, remember that a template is a page; many people use the term for other things; see Help:Template).
 * Bryan Henderson (giraffedata) (talk) 19:34, 26 January 2024 (UTC)
 * Does that number include all of the /doc pages, sandboxes, testcases, and any other template subpages? If so, I would suggest that the actual number is probably no more than 1/3 of that total.
 * That's a good point. I was wrong that essentially all pages in the Template namespace are templates.  Bryan Henderson (giraffedata) (talk) 17:52, 27 January 2024 (UTC)
 * when i mean help pages i mean any page like Help:, Wikipedia:, or any other similar pages and i used the term "help page" in an unclear way Whenthecat (talk) 20:54, 29 January 2024 (UTC)
 * So what is a template in such a page? Templates don't exist within pages.  Bryan Henderson (giraffedata) (talk) 21:30, 29 January 2024 (UTC)

Template recursion limits
I attempted to clarify the recent change to the page's description of the restriction on a template calling itself. My change was reverted in its entirety by User:Mathglot, and I looked at the discussion at VPT and discovered that I had misunderstood the rule.

The fact that I didn't understand the restriction when I read it on this help page proves it isn't clear, and I'd like to fix it.

It appears to me that User:PrimeHunter is saying that any attempt by a template to call itself during expansion fails, but that there's no restriction on a template calling itself when the template page is being displayed itself. The ability for a template to call itself when displayed is widely used for documentation, because it means when you display a template, you can see an example of the template result.

The text as it stands is

Generally, template recursion is forbidden; that is, a template may not call itself. Attempting to do so produces an error message and causes the page to be marked by MediaWiki as having a template loop. The one exception is that a template may call itself on its own template page for the purpose of documentation.

I find this confusing because a) it's not clear whether "forbidden" is just a policy or MediaWiki implementation. This appears to say you don't get the error message if the template calls itself for documentation, as if there's some way MediaWiki can distinguish a documentation call.  "Call itself on its own template page" is really confusing, because "template page" just means "template", with emphasis on the fact that a template is a page, and how would a template call itself on any other page?  A call to a template on the template's own page is in fact rejected when you try to expand that template (page).

Also, I don't understand what "marked as having a template loop" means. Where is this marking?

How about this:

Template recursion does not work. Expansion of a template that calls itself fails with an error message. However, you can display a template page directly that contains a call to itself, and this is widely done for documentation, so the reader of the page can see an example of the template result. Bryan Henderson (giraffedata) (talk) 04:21, 25 February 2024 (UTC)
 * See this instance of Template:X14. It displays a message similar to: Template loop detected: Template:X14 . It's also in . -- Red rose64 &#x1f339; (talk) 20:25, 24 February 2024 (UTC)
 * Giraffedata, Thank you for bringing this here. I agree that "forbidden" is ambiguous, and perhaps "not supported by mediawiki software and returns an error" is better. X14 is an obvious case because it calls itself directly, but earlier, I had created templates Draft:Recur-A and Draft:Recur-B to clear up any misunderstanding about whether the issue is merely direct vs. indirect calls, to show that neither is permitted. You can't determine that from X14 alone, but you can see that indirect loops also throw errors here:
 * But at this point, it sounds like we are just trying to find the right wording, is that your view as well? If so, then I believe briefer is better, and the fewer words we can use to say that except for Template doc it won't work so don't even try, the better. Mathglot (talk) 22:18, 24 February 2024 (UTC)
 * Made an attempt to tighten up the wording and respond to your issues. See what you think. Mathglot (talk) 01:23, 25 February 2024 (UTC)
 * The basic problems are still there. "Unsupported" is as ambiguous as "forbidden".  Unsupported typically means someone won't help you do it -- it might work, but you're on your own.  You get no support.  Recursion just plain doesn't work -- you can't do it, so why don't we just say that?  And it isn't true that whether a template call works or not depends on whether it is called for the purpose of documentation.  The distinction is that it works when the template is displayed, but not when the template is expanded.
 * If you want to keep it brief, then just don't mention documentation as an application of a template calling itself at all. The page explains elsewhere the difference between expanding and displaying a template and the concept of displaying a template to see documentation.  Bryan Henderson (giraffedata) (talk) 04:21, 25 February 2024 (UTC)
 * I see what the problem is now. The term unsupported in the world of a software feature is an ambiguous term, and can either mean what you inferred regarding no customer service, but just as often means the software is not capable of it:
 * Currently, MyEclipse Blue Edition is available for Windows and Linux, though Mac is unsupported.&#91;1&#93;
 * applications are single-threaded; multithreading in Trusty userspace currently is unsupported&#91;2&#93;
 * Development using either HTML5 or WinJS is unsupported on Windows Phone 8.&#91;3&#93;
 * As the symbol is unsupported by Ceefax/Teletext, a number sign - which resembles a musical sharp - is substituted.&#91;4&#93;
 * This setting is not used by all platforms; changing its value is unsupported.&#91;5&#93;
 * I used unsupported in that sense, but I'll try to find different wording. The phrase does not work is out, because like a car that does not work, it implies that something is wrong with it that need repair—that is not the case here, as it is working as designed. Mathglot (talk) 23:25, 25 February 2024 (UTC)
 * Changed it to:
 * Template recursion is not available; that is, a template may not call itself directly, or indirectly by calling other templates which call it. Attempts to do so will result in an error message describing a "template loop".
 * Mathglot (talk) 23:30, 25 February 2024 (UTC)
 * Thank you. And I agree about the problem with "does not work".
 * On the matter of "support", you're absolutely right that it is often used exactly the way you used it, in addition to many other ways. I change "support" almost everywhere I see it in a technical context in Wikipedia both because of its ambiguity and the fact that there is always a plainer way to say whatever it's supposed to say.  I think "support" is one of those things people say because it sounds smarter.  Fundamentally, support means to hold up; metaphorically, it means to assist.  When I read "the website supports JPEG", I wonder, "Does JPEG need this website's support?".  Bryan Henderson (giraffedata) (talk) 20:01, 26 February 2024 (UTC)
 * On the matter of "support", you're absolutely right that it is often used exactly the way you used it, in addition to many other ways. I change "support" almost everywhere I see it in a technical context in Wikipedia both because of its ambiguity and the fact that there is always a plainer way to say whatever it's supposed to say.  I think "support" is one of those things people say because it sounds smarter.  Fundamentally, support means to hold up; metaphorically, it means to assist.  When I read "the website supports JPEG", I wonder, "Does JPEG need this website's support?".  Bryan Henderson (giraffedata) (talk) 20:01, 26 February 2024 (UTC)

Need some iPhone and Android users to look at this sticky-header table template
We especially need some iphone users to look at the test sandboxes for some proposed updates for the sticky-header template. See:
 * Village pump (technical)

A general template tuneup would be welcome too. See anything that can be improved? Comment there please. --Timeshifter (talk) 12:18, 29 February 2024 (UTC)

Nesting template
in the nesting templates section under creating templates, in the second example, shouldn't it have a '3' in the line of code for template A, instead of a '1'? Or am I missing something?  Jo e J Sh mo 💌 08:00, 19 July 2024 (UTC)
 * Yes, it should by 3. I've fixed it.  Bryan Henderson (giraffedata) (talk) 17:00, 19 July 2024 (UTC)