Jump to content

Wikipedia talk:Substitution/Archive 1

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia
The discussions on this article has been copied from a different article. -- Zondor 19:33, 15 November 2005 (UTC)
Archive 1Archive 2Archive 3Archive 5

{{vfd}}

{{vfd}} vs. {{subst:vfd}}

Sorry for being ignorant, but what's the difference between {{vfd}} and {{subst:vfd}}? I've gotten myself into the habit of doing {{vfd}} for speed. Am I causing a problem by doing this, and what is it? The only difference appears to be that {{vfd}} stays as a template link (which is easy to remove from a kept article), and {{subst:vfd}} 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 {{vfd}} instead of {{subst:vfd}}. The benefits of using subst include:
  1. Allows you to edit the tag itself. Useful for special cases where you're listing multiple pages for deletion, since [[Wikipedia:Votes for deletion/{{PAGENAME}}|its entry on that page]] doesn't work unless the VfD subpage is an exact match.
  2. 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 "{{vfd}}".
  3. Extremely minor benefit: less strain on the database as it doesn't have to access Template:Vfd when rendering the article.
Hope this helps... • Benc • 06:45, 22 Sep 2004 (UTC)
I guess that answers some of the rationale. Although...
  1. I could see doing it that way, in that uncommon special case.
  2. 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.
  3. 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. • Benc • 00:02, 23 Sep 2004 (UTC)
  1. {{subst:vfd}} is a pain in the ass for mirrors and violates Wikipedia: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 {{subst:vfd}} 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 {{vfd}}. — 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:
      {{vfd}} <!-- do not remove -->
    • 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)

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 警告 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 {{subst:vfd}} instead of {{vfd}} to pages?msh210 19:08, 14 Apr 2005 (UTC)

What it effectively does is replace {{vfd}} with the actual template text (enclosed with <div> and </div>). The reason why we prefer this is that template substitution reduces load on the template. If you just add {{vfd}} to the article, the original template is still linked to the article, but if you use {{subst:vfd}}, 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#{{vfd}} vs. {{subst:vfd}}]].) —Korath (Talk) 19:56, Apr 14, 2005 (UTC)

{{vfd}} vs.{{subst:vfd}}

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 {{vfd}} - 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 →•← 13:52, 18 May 2005 (UTC)
This has been extensively discussed here. The overwhelming conclusion was that the benefits of {{subst:vfd}} 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)

Subst must be used for calling VfD warning

Subst?

Is there any reason why this footer advocates the use of {{subst:vfd}} instead of {{vfd}}? 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#Shorthand for old discussion of this. -- Cyrius| 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 Wikipedia: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#Substitution and REVISIONUSER, 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. -- œ 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 <references />, 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 <pre> tags). Thanks. RiverStyx23{submarinetarget} 15:02, 1 January 2013 (UTC)

Maybe try <includeonly></includeonly> 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{submarinetarget} 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{submarinetarget} 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 [details removed] as the president of Trinidad and Tobago. [details removed] 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

President of Trinidad and Tobago (edit | talk | history | protect | delete | links | watch | logs | views)
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 {{Nosubst}} 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

Wikipedia:Village pump (technical)/Archive 130#Auto-subst. 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,

<small>({{subst:CURRENTYEARYY}}.{{subst:LOCALMONTH}}.{{subst:LOCALDAY2}})</small>

which should (as of today) leave

<small>(15.05.13)</small>

when I save the page, to display as

(15.05.13)

a constant string that will not change.

Instead, it leaves

({{YEARYY|{{CURRENTYEAR}}}}.05.13)

which appears as

(24.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 subst the current year? To discuss this, please {{Ping}} me. --Thnidu (talk) 18:05, 13 May 2015 (UTC)

Why jump through hoops when you can {{subst:#time:y.m.d}} → 15.05.13 --Redrose64 (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 {{subst:Wikipedia talk:Substitution}} 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? --Redrose64 (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 {{#switch:{{{1}}}|great=great|nice=nice}} 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 <includeonly></includeonly> tags, but that didn’t work, unfortunately.
PapíDimmi (talk | contribs) 08:46, 1 September 2016 (UTC)

@PapiDimmi: I think that is not possible. But you can save the page edit and subst the switch again.

Example:

{{subst:template above|great}}

by saving you get:

This is a {{#switch:great|great=great|nice=nice}} sentence

type now:

This is a {{subst:#switch:great|great=great|nice=nice}} 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 {{subst:date|2015-02-13|mdy}} work inside a <ref>?

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: "Wikipedia". February 13, 2015.

But it doesn't work inside a {cite} inside a <ref>: <ref>{{cite web |url= https://en.wikipedia.org |title= Wikipedia |date= {{subst:date|2015-02-13|mdy}}}}</ref> leaves this (with {subst} un-executed): [1]

  1. ^ "Wikipedia". {{subst:date|2015-02-13|mdy}}. {{cite web}}: Check date values in: |date= (help)

I think {subst} should work everywhere. Maybe there is a reason it shouldn't. -A876 (talk) 07:19, 9 February 2018 (UTC)

See phab:T4700. Anomie 12:40, 9 February 2018 (UTC)
Thanks. That is a bug report on Maniphest bug tracker, in Wikimedia's installation of Phabricator (see Wikipedia:Phabricator).
phab:T4700: "Pre-save transform skips extensions using wikitext (gallery, references, footnotes, cite, status indicators, pipe trick, subst, signatures)".
That sounds like it covers my case. My examples seem to show "pre-save transform" working inside {cite}, so that aspect might be fixed. I see "pre-save transform" not happening inside <ref>...</ref>
  • 2005-07-04 Reported.
  • Several duplicate bugs were merged.
  • 2010-02-06 "The pipe-trick part of this is now resolved. subst: can be fixed by using safesubst: instead, ..." (what?)
  • 2011-12-19 "I just noticed that subst isn't working inside of <ref> tags: ..." (matches my complaint)
  • 2014-11-21 "bzimport raised the priority of this task from to High".
  • 12.5 years unfixed. (so far)
I previewed {safesubst:} inside my <ref>, and it works! I could have used {safesubst:} !
{safesubst:} is not mentioned at Wikipedia:Substitution. {safesubst:} is mentioned at Help:Substitution#The safesubst: modifier (which I found only via this soft redirect – {subst:} and {safesubst:} are not templates, but, as modifier prefixes, they look a little bit like templates). -A876 (talk) 16:57, 9 February 2018 (UTC)

Cleanup templates

I've had a read through the page to try and clarify, but couldn't see anything that explicitly dealt with this. Am I right in saying: Cleanup templates should not be substituted, but dates may be substituted inside cleanup templates (e.g. {{subst:citation-needed}} with |date={{CURRENTMONTHNAME}}{{CURRENTYEAR}} would be incorrect, but {{citation-needed}} with |date={{subst:CURRENTMONTHNAME}}{{subst:CURRENTYEAR}} would be allowed? If so, would anyone be able to provide a more explicit treatment of substituting date functions and other magic words? — Sasuke Sarutobi (push to talk) 13:58, 4 February 2019 (UTC)

@Sasuke Sarutobi: Generally speaking, we do not substitute cleanup templates. This is mainly because substitution is intended for use when a permanent change is desired, such as serving a warning on a user talk page. Cleanup templates are intended to be temporary; they are removed as soon as the issue has been addressed. Thus, they need to be simple to remove - if you see this:
{{citation needed|date=February 2019}}
in the wikitext for the page, it's far easier to decide what needs removing than if you see this:
[[Category:All articles with unsourced statements]][[Category:Articles with unsourced statements from February 2019]]<sup class="noprint Inline-Template Template-Fact" style="white-space:nowrap;">&#91;<i>[[Wikipedia:Citation needed|<span title="This claim needs references to reliable sources.&#32;(February 2019)">citation needed</span>]]</i>&#93;</sup>
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 {{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 |date= parameter had been omitted, it will automatically be added with the appropriate month and year. That is, if you try {{subst:citation needed}} on or before 28 February 2019, what you will actually get will be {{citation needed|date=February 2019}}.
As far as {{CURRENTMONTHNAME}} and {{CURRENTYEAR}} are concerned - these must not be used in a |date= parameter, because we need to know when the {{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 {{subst:CURRENTMONTHNAME}} and {{subst:CURRENTYEAR}} is quite all right. --Redrose64 🌹 (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. {{citation-needed|date={{subst:CURRENTMONTHNAME}}{{subst: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 {{citation-needed|date={{subst:CURRENTMONTHNAME}}{{subst:CURRENTYEAR}}}} as you're writing it is not correct, as there needs to be a space in between the month and year: {{citation-needed|date={{subst:CURRENTMONTHNAME}} {{subst: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. --Redrose64 🌹 (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)