Wikipedia talk:Substitution/Archive 1

vs.
Sorry for being ignorant, but what's the difference between and  ? I've gotten myself into the habit of doing for speed. Am I causing a problem by doing this, and what is it? The only difference appears to be that stays as a template link (which is easy to remove from a kept article), and  actually inserts the text of the template into the article. Other than that, they both do the exact same thing. - KeithTyler 23:44, Sep 21, 2004 (UTC)
 * Several reasons, all of them relatively minor. It really doesn't hurt anything if you use instead of  . The benefits of using subst include:
 * Allows you to edit the tag itself. Useful for special cases where you're listing multiple pages for deletion, since its entry on that page doesn't work unless the VfD subpage is an exact match.
 * Discourages vandalism, a little. The average newbie who has just created an inappropriate page will be less apt to remove the entire wikicode for the tag, rather than a short " ".
 * Extremely minor benefit: less strain on the database as it doesn't have to access Template:Vfd when rendering the article.
 * Hope this helps... &bull; Benc &bull; 06:45, 22 Sep 2004 (UTC)
 * I guess that answers some of the rationale. Although...
 * I could see doing it that way, in that uncommon special case.
 * But the average newbie might more easily accidentally corrupt part of the tag, meaning more cleanup work for the non-newbie to reinsert the tag.
 * Of course, if the VFD tag is changed/updated/improved, the subst: method won't reflect the improvement.
 * - KeithTyler 18:49, Sep 22, 2004 (UTC)

What does "subst" actually stand for? Joyous 23:59, Sep 22, 2004 (UTC)
 * Substitute. &bull; Benc &bull; 00:02, 23 Sep 2004 (UTC)


 * 1)  is a pain in the ass for mirrors and violates Avoid self-references.
 * 2) using subst makes it impossible use "what links here" to find articles where the tag was kept after delisting from vfd (both valid and malicious delisting).

anthony (see warning) 05:40, 1 Oct 2004 (UTC)

I want to bring this up again. I think the has more disadvantages than advantages. Apart from what Anthony mentioned in the previous post, the large and scary subst block has the potential to scare away a newbie from editing the article. Perhaps that same newbie would be able to bring the article above deletion standard. The subst has the same effect as a really large HTML style table at the beginning of an article. I suggest we go back to recommending. &mdash; David Remahl 20:13, 17 Nov 2004 (UTC)
 * I disagree. Newbies are not children, and we shouldn't base our policies on the possibilities of scaring people off. The only duty we have to newbies is not to be rude to them. The same thing goes for mirrors -- while it's great they exist, we shouldn't be bending over much to make them easy. Their existance is a fringe benefit. The subst use of the template serves a valid and good purpose -- to discourage people from trivially removing it, and to serve as a really good visual cue that it's important. --Improv 20:41, 17 Nov 2004 (UTC)
 * To a computer-literate person who knows a bit of HTML etc, it is not scary. But a newbie who is not used to markup, who clicks edit and sees a lot of things he/she does not recognise from the article, may think that editing Wiki is too difficult for him/her. To counter bias in Wikipedia we need to attract more non-technical users. Besides, is it really that much more difficult to remove ten lines compared to removing one? I usually select the whole block and press the backspace button in both cases. If we want to make it clear that the tag serves a purpose and is important, why not use:
 * &mdash; David Remahl 17:03, 18 Nov 2004 (UTC)
 * I doubt people will actually put that in, although it's not a bad idea. There are, by the way, a huge number of articles that newbies can edit -- why should we assume they should gravitate towards those on VfD? And yes, it is much more difficult to remove 10 lines -- making sure one removes the right, and only the right, lines is a bit tricky -- it takes more effort. --Improv 21:26, 18 Nov 2004 (UTC)
 * I doubt people will actually put that in, although it's not a bad idea. There are, by the way, a huge number of articles that newbies can edit -- why should we assume they should gravitate towards those on VfD? And yes, it is much more difficult to remove 10 lines -- making sure one removes the right, and only the right, lines is a bit tricky -- it takes more effort. --Improv 21:26, 18 Nov 2004 (UTC)

Making sure one removes the right lines may be hard, but removing half the VFD notice is no worse than removing all of it. Removing the VFD notice and some other text is even worse than just removing the VFD notice. In any case, it's quite trivial to revert in any of the cases. This reason doesn't really make much sense to me. subst:vfd violates Wikipedia policy, and when I see it I will replace it with the template. anthony &#35686;&#21578; 02:04, 19 Nov 2004 (UTC)
 * You just said that use of "subst:vfd violates Wikipedia policy". That's news to me.  Which policy does it violate?  Thanks.  Rossami (talk) 12:32, 19 Nov 2004 (UTC)
 * vfd also violates policy, as stated on the VfD page. When I see it, I will replace it with the substitution. --Improv 16:20, 19 Nov 2004 (UTC)

subst:vfd -- why subst?
Why should one add instead of  to pages?   &mdash;msh210 19:08, 14 Apr 2005 (UTC)


 * What it effectively does is replace with the actual template text (enclosed with  and  ). The reason why we prefer this is that template substitution reduces load on the template. If you just add  to the article, the original template is still linked to the article, but if you use , it just substitutes the contents of the template and there is no longer any link between the template and the article. That reduces the number of articles linking to the template and helps for performance issues. --Deathphoenix 19:31, 14 Apr 2005 (UTC)


 * It also makes things easier to fix when someone moves an article despite the big, shiny "Please do not... move this article while the discussion is in progress" notice. (See also Wikipedia talk:Votes for deletion/September-December 2004.) &mdash;Korath (Talk) 19:56, Apr 14, 2005 (UTC)

vs.
Why must we advocate one over the other?? It seems POV, considering there are advantages to both. Jesse's Girl 13:25, 18 May 2005 (UTC)


 * What? POV only applies to encyclopedia articles, not policy pages. We don't have a policy page that says "vandalism is a bannable offence, although some people think we should have more of it". Anyway, I don't see the advantage to - since the message is only supposed to be there for a few days, there should be no need to pick up changes to the template. sjorford &rarr;&bull;&larr; 13:52, 18 May 2005 (UTC)


 * This has been extensively discussed here. The overwhelming conclusion was that the benefits of  outweigh the advantages of mere transclusion for this particular template.  Most of those discussions have since been moved to the archives of this page.  Rossami (talk) 14:59, 18 May 2005 (UTC)
 * I'm aware of this, but I do not know where to find those...Could you point me to the exact discussions? Jesse's Girl 15:01, 18 May 2005 (UTC)
 * Here is a partial list based on what I found by quickly scanning the archives. I also remember other discussions that I have not yet been able to find.  I think some of the better discussions have been moved over to Meta where I can't find them.  Note: Some of the older discussions need to be read in light of the technological capabilities which were in place at the time.  WikiMedia has made significant changes to how templates are handled.  Rossami (talk) 15:38, 18 May 2005 (UTC)
 * Wikipedia talk:Boilerplate text
 * Template talk:Vfd/Archive01 (See Angela's comment half-way down)
 * Template talk:Vfd/Archive01
 * Template talk:VfDFooter
 * Wikipedia talk:Votes for deletion/April 2004
 * Wikipedia talk:Votes for deletion/September-December 2004 and scroll down to vs.
 * Wikipedia talk:Votes for deletion/April 2005 Part Two
 * Deletion policy

Subst?
Is there any reason why this footer advocates the use of instead of  ? I thought we were moving towards templates, and I would have changed it myself, but I figured there might be an database implementation consideration why this was better for a highly used template like vfd. Can anyone say which is better? I'd rather have the template, because our vfd anchor format changes so frequently. - DropDeadGorgias (talk) 20:34, Jun 21, 2004 (UTC)


 * See Wikipedia talk:Boilerplate text for old discussion of this. -- Cyrius|&#9998; 20:54, 21 Jun 2004 (UTC)

Why
(Added bcz (not knowing already mentioned) i promised to when i changed it back to subst, and bcz it may help prevent the next well-intentioned breaking of the system.)

Because only 5 expansions of the same template get done per page. (I think true even if they're in subst format, but with subst the restriction only comes into play if you nominate 6 or more pages in the same edit -- since a subst expansion permanently becomes text (and ceases to be a subst) when it's saved.)

It's not a bug, it's an important security feature, so don't bother asking to change it. The link above probably goes into the details, for those interested. --Jerzy(t) 01:11, 2004 Aug 21 (UTC)
 * Why would you have more than 5 VFD notices on the same page? Using subst: violates Avoid self-references. And if one wants to stop people from changing it simply protecting the page is available.  anthony (see warning) 10:59, 4 Sep 2004 (UTC)

Subst a template within a template?
Is there any way to make a template call on an article page, and have one of the templates used within a template be substituted to the article page but not the entire template? What I was thinking was having a defined template that had predefined article sections within the template, that would then have those section headings "subst" and become a standard section heading within the article, but have the template that "brought" those headings into the article still be a template call. Lestatdelc (talk) 07:49, 1 March 2012 (UTC)

Substitution and REVISIONUSER
Pointer towards WP:Bot owners' noticeboard, concerning substitution of certain templates by bots. Amalthea 17:19, 3 May 2010 (UTC)

Templates or Pages
In cleaning up the intro, I noticed a lack of clarity regarding the target of substitution. Is it just templates that can be substituted, or can any page be substituted? It's clear the guideline's focus is on templates, but just for precision, it'd be good to make the intro fit. 69.142.154.10 (talk) 08:54, 12 July 2010 (UTC)


 * Well yes, any page can be substituted OR transcluded. But usually there's no point in substituting any page other than a template. -- &oelig; &trade; 09:45, 12 July 2010 (UTC)


 * Help:Substitution offers: '"Substitution is the replacement of a piece of wikicode with its value on saving the page. In particular: a template call is replaced by the template content (with substitution of any parameters); a variable is replaced with its value; a parser function is evaluated." So, for probably 99+% of practical purposes it's all templates. Ocaasi (talk) 12:02, 12 July 2010 (UTC)

Reflist
Just out of interest, what would happen if you subsituted a reflist?  Rcsprinter  (talk)  08:18, 3 June 2011 (UTC)
 * I guess you'd just get some expanded text appearing in the wikitext, that has the same effect as a reflist. (But if you want to know for sure, try it and see.)--Kotniski (talk) 14:30, 3 June 2011 (UTC)
 * I tried it in my sandbox, and that's just what happened.  Rcsprinter  (talk)  19:03, 3 June 2011 (UTC)


 * Reflist is just a wrapper around, which is special-cased by MediaWiki. Parsing of the current footnotes system is always done at runtime. Chris Cunningham (user:thumperward) - talk 21:53, 14 July 2011 (UTC)

Help?
Could someone look at Wikipedia_talk:Articles_for_creation/Template:OnProd? Something is weird. Every time I look at the code, the parameters for the #time parser function get replaced by the real date, meaning if I view the template code I will not be able to edit and save it without re-writing because the code will be replaced by the current date. Very bothersome, and I'm not that good at understanding what I've messed up (which is why I save the template for this AFC inside the  tags). Thanks. RiverStyx23 15:02, 1 January 2013 (UTC)
 * Maybe try tags around the date and time parameter so it does not substitute in the template itself before transclusion.--Fuhghettaboutit (talk) 15:11, 1 January 2013 (UTC)
 * I think that did it - take a look at it now? RiverStyx23 15:39, 1 January 2013 (UTC)
 * Just tested; seems to be working.--Fuhghettaboutit (talk) 15:49, 1 January 2013 (UTC)
 * Thanks for klewing me in. I am now a templater! RiverStyx23 15:59, 1 January 2013 (UTC)
 * Anytime.--Fuhghettaboutit (talk) 16:04, 1 January 2013 (UTC)

Substitution of Help me-helped
There was an edit war discussion on whether this template should be substituted. I think it should not, as the template is often placed on the talk pages of new users, and the potential confusion caused by the clutter for new users who are often unfamiliar with wiki-markup and HTML outweighs the marginal performance benefits of substitution (especially since it's relatively infrequently used, and then mostly on low-visibility user talk pages). Input would be appreciated. wctaiwan (talk) 07:09, 1 February 2013 (UTC)


 * (disclaimer) I was the one doing the substitution. I don't think this template (which is about 400 characters minus the commented-out part) will confuse anyone with a functioning brain; if anything, editing Wikipedia requires basic knowledge of HTML, and I don't think a simple, fairly self-explanatory template will cause anybody's head to fall off.
 * Also, I'm aware that there's no major performance gain - I just don't think there's a point to transcluding such a light-weight template when we could easily substitute it. m.o.p  07:13, 1 February 2013 (UTC)


 * My opinion is if it ain't broke, don't fix it. If any template works unsubsted, there is no reason to change it anywhere it is in use, and vise versa. Same reasoning as behind WP:NOTBROKEN and in WP:BROKEN. Prodego  talk  07:29, 1 February 2013 (UTC)


 * I'd prefer this not to be subst'd, too. Currently, the helper adds the "-helped" suffix, and the requester can ask for more help just by deleting the suffix. -- John of Reading (talk) 09:10, 1 February 2013 (UTC)
 * Yeah I agree with wctaiwan and John. Legoktm (talk) 09:31, 4 February 2013 (UTC)

False Entry in Wikipedia
The following link lists as the president of Trinidad and Tobago. is a student in the school where I work. Last week he edited the wiki page and put himself in as president. Once we discovered this we suspended him from school and the page was restored. The next day I noticed that the change had been made again but I do not know who made the change. I hope the change can be made to list the true president. Thanks, http://en.wikipedia.org/wiki/President_of_Trinidad_and_Tobago Sacred Heart School, acarchedi@sacredheart-boston.org 50.177.178.185 (talk) 15:45, 20 May 2014 (UTC)Anne Carchedi
 * Thanks for reporting this. I have undone the false edit and will keep an eye on the page. I have removed the student's name from your post here, as this page may be indexed by search engines. -- John of Reading (talk) 15:57, 20 May 2014 (UTC)
 * Thanks for reporting this. I have undone the false edit and will keep an eye on the page. I have removed the student's name from your post here, as this page may be indexed by search engines. -- John of Reading (talk) 15:57, 20 May 2014 (UTC)

signatures with no substitution
The template should sign with a transcluded signature template after you sign with four tildes. It maybe the possible answer on Wikia. I replaced it where it's not substituted a signature after it was signed. -- Allen   talk 23:17, 19 July 2014 (UTC)

Discussion about changing substitution behavior
Village pump (technical)/Archive 130. For future readers, this will probably one day be in Archive 130 or 131. Oiyarbepsy (talk) 22:22, 8 September 2014 (UTC)

CURRENTYEARYY doesn't subst
I keep a string handy for timestamps in the logs in my userspace,

which should (as of today) leave

when I save the page, to display as
 * (15.05.13)

a constant string that will not change.

Instead, it leaves

which appears as
 * (.05.13)

— not small, and updating when the year changes, which is obviously no good for a timestamp.

Currently my only workaround is to manually change the year in my saved string every New Year's Day. Granted, this is only a small nuisance, but it shouldn't be necessary. How can I  the current year? To discuss this, please me. --Thnidu (talk) 18:05, 13 May 2015 (UTC)
 * Why jump through hoops when you can  → 15.05.13 -- Red rose64 (talk) 18:53, 13 May 2015 (UTC)
 * It does subst, just not the way you expect. If you want to fix that template, see Help:safesubst. Anomie⚔ 22:07, 13 May 2015 (UTC)

Substituting the page itself
When you substitute a page onto itself, the previous version of the page will be substituted. GeoffreyT2000 (talk) 06:38, 22 November 2015 (UTC)
 * No, it's the current version at the moment before saving: if I replace the whole of this page with  and save, there is no change - if it saved the previous version, your post here would have disappeared. But why would you want to substitute a page onto itself? -- Red rose64 (talk) 15:19, 22 November 2015 (UTC)

How do I choose code not to be transcluded onto the page?
I have a template with a #switch parser function, but I don’t want the #switch parser function to appear in the transcluded code.

Example: This is a sentence

The #switch parser will still be included when the template is transluded onto a page. Is there a way to just include “This is a sentence,” “This is a great sentence,” or “This is a nice sentence,” without the #switch parser being included?

I tried the  tags, but that didn’t work, unfortunately. ―  PapíDimmi  (  talk |  contribs  ) 08:46, 1 September 2016 (UTC)
 * I think that is not possible. But you can save the page edit and subst the switch again.

Example: great by saving you get: This is a sentence type now: This is a sentence by saving you get: This is a great sentence

--Bigbossfarin (talk) 13:26, 10 January 2017 (UTC)
 * It's possible, see for example Template:Citation needed which substs an #invoke. #switch would work the same way. Anomie⚔ 15:20, 10 January 2017 (UTC)

Should 2015-02-13 work inside a ?
The {date} template "should only be used internally in other templates." But someone used it on a page anyway, 57 times. To avoid manually converting every unique date, I tried global-replacing "{{date" with "{{subst:date", but it didn't work. It failed in preview and it failed after save.

{subst} works most places, but not everywhere. (Click "Edit" to see the code created here by subst when I saved.)

It works outside a {cite}:  {{subst:date|2015-02-13|mdy}}  makes this: February 13, 2015

It works inside a {cite}:  {{cite web |url= https://en.wikipedia.org |title= Wikipedia |date= {{subst:date|2015-02-13|mdy}}}}  makes this: {{cite web |url= https://en.wikipedia.org |title= Wikipedia |date= February 13, 2015}}

But it doesn't work inside a {cite} inside a ''' leaves this (with {subst} un-executed): in the wikitext for the page, it's far easier to decide what needs removing than if you see this:   You might not know how much to remove, so you might remove just part of the message - or even remove the message but leave the categories.
 * However, some cleanup templates, including {{tlx|citation needed}}, have been designed in such a way that an attempt to subst them will merely resolve to the unsubstituted form; moreover, if the {{para|date}} parameter had been omitted, it will automatically be added with the appropriate month and year. That is, if you try {{tlxs|citation needed}} on or before 28 February 2019, what you will actually get will be {{tlx|citation needed|2=date=February 2019}}.
 * As far as {{tlc|CURRENTMONTHNAME}} and {{tlc|CURRENTYEAR}} are concerned - these must not be used in a {{para|date}} parameter, because we need to know when the {{tlx|citation needed}} was actually added - if the date changes every month, it's pointless having it and we might as well do away with the date. But using {{tlc|subst:CURRENTMONTHNAME}} and {{tlc|subst:CURRENTYEAR}} is quite all right. -- Red rose64 &#x1f339; (talk) 00:15, 5 February 2019 (UTC)
 * Thank you, I thought so. I ask because I notice that when some cleanup templates are inserted via VisualEditor, they will automatically populate with a substituted date field (e.g. {{tlx|citation-needed|date{{=}}{{tls|CURRENTMONTHNAME}}{{tls|CURRENTYEAR}}}}), but other cleanup templates don't. I was considering going through some more templates to set them up in the same manner, but I wanted to first check that such usage (i.e. substituted dates in an unsubstituted cleanup tag) was recommended before I look at adding it to any more templates. — Sasuke Sarutobi (push to talk) 12:33, 5 February 2019 (UTC)
 * Note that {{tlx|citation-needed|date{{=}}{{tls|CURRENTMONTHNAME}}{{tls|CURRENTYEAR}}}} as you're writing it is not correct, as there needs to be a space in between the month and year: {{tlx|citation-needed|date{{=}}{{tls|CURRENTMONTHNAME}} {{tls|CURRENTYEAR}}}}. Ideally VE would just put the month and year in there instead of having to substitute CURRENTMONTHNAME and CURRENTYEAR, but I suppose that it needs constant text to inject rather than text changing every month. Anomie⚔ 21:55, 5 February 2019 (UTC)

Is there a way to subst while leaving unsupported parameters intact?
An issue has been raised at Template talk:Lien web that concerns parameters not defined in a substed template. For example, if a subst-only template handles author1 and author2 in its substing code, but it does not mention author3 at all, it appears that author3 and its value will be dropped (deleted) when the template is substed. This may not always be desirable.

Is there a way to subst so that undefined parameters are left in the substed code? It's OK if they are not rendered, or if they render error messages, but it would be nice for them to be preserved instead of deleted. – Jonesey95 (talk) 16:09, 17 October 2020 (UTC)
 * No. -- Red rose64 &#x1f339; (talk) 22:40, 17 October 2020 (UTC)

"Templates that must be substituted" section
"cfd, cfr, cfm, which insert comments which serve as queues for Cydebot, which is used to rename or merge categories."

Cydebot has been blocked as a malfunctioning bot for over a year. Shouldn't this bit be removed? widgethocker (talk) 21:27, 16 January 2021 (UTC)