Template talk:NOTOC: Difference between revisions

 

Line 39: Line 39:

{{ping|Rich Farmbrough|Fayenatic london|Anomie}} Revisiting this discussion on {{tl|No ToC}} and {{tl|NOTOC}}. Regarding the concerns that {{tl|NOTOC}}:

{{ping|Rich Farmbrough|Fayenatic london|Anomie}} Revisiting this discussion on {{tl|No ToC}} and {{tl|NOTOC}}. Regarding the concerns that {{tl|NOTOC}}:

# doesn’t actually add <code>c</code> when transcluded;

# doesn’t actually add <code></code> when transcluded;

# adds a visible error to articles when transcluded;

# adds a visible error to articles when transcluded;

# adds {{tq|an unnecessary message reprimanding an editor}};

# adds {{tq|an unnecessary message reprimanding an editor}};

Why should it be subst’ed? EEng 01:37, 19 October 2017 (UTC)[reply]

@EEng: I’m pretty sure transcluding a template with a magic word takes up more bandwidth than using the magic word directly. Interqwark talk contribs 03:30, 13 June 2018 (UTC)[reply]

Thanks, but I’d like to hear that from a techie. See Wikipedia:Don’t worry about performance. EEng 03:53, 13 June 2018 (UTC)[reply]
If you mean actual Internet browser bandwidth: no it doesn’t. The template is expanded by the server rendering engine, then interpreted to not insert any ToC. Nothing is sent to the browser in either case. All the best: Rich Farmbrough 13:13, 10 July 2025 (UTC).[reply]
See also Help:Substitution#When to use substitution (the template is here as long as the code itself, when is substituted, so there is no benefit at all with the template, but there are more problems than the performance problems, i.e. if an article gets translated into another language, where there are no such templates, but only the code itself), Why is the use of magic word templates discouraged? and Category:Pages which use a template in place of a magic word. —2A02:908:D83:E460:216:CBFF:FEAD:FF9 (talk) 22:09, 9 August 2019 (UTC)[reply]

It’s child’s play to move the template over. And if required a translation can be created too. All the best: Rich Farmbrough 12:56, 10 July 2025 (UTC).[reply]

Please add the [[Category:Wikipedia templates to be automatically substituted]] to the page, so that bots can substitute all transclusions, as the template says. It should never have so many transclusions anyway, it is in the Category:Wikipedia transclusionless templates. And this template doesn’t need to be protected, because it should have no transclusions at all. When the bots will have substituted all transclusions, it can be unprotected again.

See Help:Substitution#When to use substitution, discussion Why is the use of magic word templates discouraged?. See also Template:FORCETOC which has a red error message for the right syntax and no transclusions at all. This should also be the case for this template. Only to write “This template should always be substituted” on the template page is not enough. People copy the code from other articles, and that is the reason that there are so many transclusions now which never should be there.

And see especially the deletion discussions Wikipedia:Templates_for_deletion/Log/2007_January_27#Template:NOTOC with the result delete (has been deleted in 2007 and there has been no discussion to restore it after the deletion discussion) and another discussion Wikipedia:Templates_for_discussion/Log/2016_October_16#Template:NOEDITSECTION. That very similar simple magic word template Template:NOEDITSECTION still is deleted, why is this one so often trancluded in opposite to the deletion discussion and all other pages saying the opposite? This template always makes problems in articles which are translated into other languages, and there is no benefit at all. In my opinion, it should better get deleted again, but if a bot automatically substitutes the transclusions, that can also be a solution for the problems. —2A02:908:D83:E460:216:CBFF:FEAD:FF9 (talk) 22:52, 9 August 2019 (UTC)[reply]

See also User talk:AnomieBOT/TemplateSubster force#Template-protected edit request on 9 August 2019 for the bot to substitute the transclusions which are already there. After these first substitutions, it should do that directly after each wrong template use, so people will learn better, how to use it in the right way. —2A02:908:D83:E460:216:CBFF:FEAD:FF9 (talk) 00:01, 10 August 2019 (UTC)[reply]

 Not done: {{edit semi-protected}} is usually not required for edits to the documentation, categories, or interlanguage links of templates using a documentation subpage. Use the ‘edit’ link at the top of the green “Template documentation” box to edit the documentation subpage.. * Pppery * it has begun… 02:37, 10 August 2019 (UTC)[reply]
 Done and then eraser Undone. Rather than adding the category manually, you should set |auto=yes in the {{subst only}} statement on the doc subpage. However, according to the doc, this won’t do anything yet since there are over 100 transclusions. If the other request is approved and no one makes the change here, then it would be okay to add it in. –Deacon Vorbis (carbon • videos) 02:55, 10 August 2019 (UTC)[reply]

 Done, both requests. — JFG talk 03:45, 10 August 2019 (UTC)[reply]

@Rich Farmbrough: why do we need a separate CamelCase version at Template:NoToC with different code? This one has safesubst features; are you testing something that requires not using that feature? – Fayenatic London 08:36, 10 July 2025 (UTC)[reply]

This one plasters a dayglo pink warning on the article instead of implementing the NOTOC functionality. Basically it says “Grow up and use double underline NOTOC.” I really don’t see it need be anything other than __NOTOC__. If someone were to subst it, it would put the magic word in. (And even that might be a good thing, if they had forgotten the double underlines before and after the keyword.) All the best: Rich Farmbrough 12:55, 10 July 2025 (UTC).[reply]

To illustrate:

{{NOTOC}}: incorrect syntax, use {{subst:NOTOC}} or __NOTOC__ instead.

All the best: Rich Farmbrough 13:09, 10 July 2025 (UTC).[reply]

See also section 1 at the top. All the best: Rich Farmbrough 21:26, 11 July 2025 (UTC).[reply]

Now that we have AnomieBOT substing the template, maybe there’s no point to having that warning. Just let it work until the bot comes along in a few hours. Anomie 17:51, 6 October 2025 (UTC)[reply]

@Rich Farmbrough, Fayenatic london, and Anomie: Revisiting this discussion on {{No ToC}} and {{NOTOC}}. Regarding the concerns that {{NOTOC}}:

  1. doesn’t actually add __NOTOC__ when transcluded;
  2. adds a visible error to articles when transcluded;
  3. adds an unnecessary message reprimanding an editor;

for 1. the __NOTOC__ can be outside the {{ifsubst}} to be active when transcluded, and for 2. the {{error}} can be changed to a {{Preview warning}}, as proposed in {{NOTOC/sandbox}}.

For 3., would you like to propose a nicer message? Do you have other concerns in mind?

With bots that substitute {{NOTOC}}, I also don’t think the separate {{No ToC}} is necessary. (It can still be a redirect if bots can subst it.) — Peterwhy (talk) 23:36, 27 January 2026 (UTC)[reply]

I don’t think we should be using these weird techy dunder keywords in articles. I think we should be using simple wiki-markup. Templates are part of core markup. I also believe we should write in normal English rather than all-caps run together words. We disposed of camel case links decades ago, and fixed most title case and all-caps template names. I’m happy for the templates to share code, but not for the one that uses English to be replaced with shouty all-caps that could mean “not oc” “no to c” “no operating thetans or Cretans”. Maybe the target of the redirects should be Template:No table of contents”. Then the meaning would be clear to all editors. All the best: Rich Farmbrough 05:37, 28 January 2026 (UTC).[reply]

I should note that a discussion referred to way above, itself refers to another page that is talking about the type of magic word that is contained in double curly braces, rather than dunder or hash or naked magic words. All the best: Rich Farmbrough 05:47, 28 January 2026 (UTC).[reply]

My focus is more on the two separate templates about the same __NOTOC__, so I do want to make the main {{NOTOC}} usable and “transcludable” (as proposed in the sandbox). I can’t comment on whether the “NOTOC” name chosen by MediaWiki is the most appropriate, but as usual alternative names can be redirects and the doc can clarify what this wrapper {{NOTOC}} does in normal English. Then even for those editors who has forgotten whether this is dunder and double curly braces, and publish code while ignoring all the signals, the code behaviours should still be the same. — Peterwhy (talk) 07:09, 28 January 2026 (UTC)[reply]

I’m happy to just replace the text of this template with __NOTOC__ or redirect this to {{No ToC}}. Everything should then work without noisy warnings which is an improvement. The bot will still do what the bot does which I may not see as ideal, but is not worse than it is now. (I’m not happy to redirect {{No ToC}} here as people are reasonably likely to break this template again.) All the best: Rich Farmbrough 11:09, 28 January 2026 (UTC).[reply]

I don’t see the warning as noisy to editors, but a pointer to the behaviour of {{NOTOC}} for (average) editors who are unaware, making life simpler. The existing error is noisy to readers who don’t plan to edit articles, so I propose to downgrade it. Having no editor message was the pre-2019 version and “broken” by the 2019 version. Otherwise, I don’t see {{NOTOC}} was ever broken by editors who confused “NOTOC” with another meaning. I am not happy with a different redirect target or canonical name other than the “NOTOC” common globally across sites, nor keeping duplicate templates if {{NOTOC}} is transcludable. — Peterwhy (talk) 19:45, 28 January 2026 (UTC)[reply]

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top