Wikipedia talk:Template substitution

From Wikipedia, the free encyclopedia

This is the talk page for discussing improvements to the Wikipedia:Template substitution page.

Archives: 1, 2, 3, 4, 5, 6


Contents

[edit] Infobox Templates

I'd like to add Category:Infobox templates to the list of templates that should not be subt'd. Not least of my reasons is that many infobox templates have dynamic parameters which need to be changed, added, or removed, and subst'ing makes this very difficult. There's also a question of uniformity. If noone replies in a day or two I'll just go ahead and be WP:BOLD. Adam McCormick 18:35, 18 July 2007 (UTC)

Being familiar with templates in general, but not being heavily involved in any specific infobox area, I would say you'd be in the right to do so. BigNate37(T) 19:12, 18 July 2007 (UTC)
Alright then, going ahead. Adam McCormick 20:09, 20 July 2007 (UTC)

[edit] Is there a way to get ParserFuncs to output straight Wikitext?

Without having to go use the ExpandTemplates page, is there a way to get a template to expand with {{subst:}} such that ParserFuncs output actual WikiText instead of the ParserFunc code? Here's the situation:

When putting Fair Use Rationales on hundreds of images that all read very similarly to each other, it's inconvenient to have to copy the FUR from one image, paste it to another image, then modify the things that vary between the two images (like the title of the image's content or the page it's being used on). I created a user template to take care of this, which takes several parameters to customize the output. Because the fair-use patrol bots don't accept user templates, I'm using subst with the template. But since there are ParserFuncs in the template code, those parserfuncs end up in the subst'd output.

Meta talks about ways to do "optional substitution" and composite templates, but I tried the techniques they described there, and I still ended up with the same result.

If someone wants to look at my template code and give me some feedback, it's here: User:KieferSkunk/furvg . If you want to test the function, feel free to use User talk:KieferSkunk/furvg as a sandbox. Thanks. :) — KieferSkunk (talk) — 22:05, 1 August 2007 (UTC)

Nevermind - User:Patrick helped me figure it out. Turns out my attempts to use the Meta techniques were only part of the solution - I missed some syntax stuff. Got it now. :) — KieferSkunk (talk) — 01:40, 2 August 2007 (UTC)

[edit] Marking templates

Has there been any discussion about marking which templates should always be substituted, either with a blank template or a category? Some of these templates don't have any transclusions; as I'm trying to clean out the Template namespace over at WP:DOT, it makes things much more difficult when I'm unable to know if a template is supposed to have no transclusions or is plainly orphaned. Any thoughts? --MZMcBride 00:13, 7 August 2007 (UTC)

[edit] Obsolete template

Album Image is now obsolete. Is there a relevant replacement that should go in the image section or should it just be taken out? JoshuaZ 00:57, 29 August 2007 (UTC)

[edit] Template:Skiptotoctalk

    Skip to table of contents    

Template:Skiptotoctalk

Should this template be substituted? There is a discussion here: Template talk:Skiptotoctalk.

I don't care either way. I was just under the impression that substitution was to be encouraged. I copied this template to the commons too, so I need to know for that template also: commons:Template:Skiptotoctalk

There is also a discussion at Template talk:Skiptotoctalk about putting a hidden note in substituted template code. To tell people how to correctly substitute the template elsewhere (with the latest code). I can't seem to get a hidden note to show up in the substituted code without problems (such as a "template loop" warning in the code).--Timeshifter 12:57, 19 September 2007 (UTC)

Per talk on other page, substing this template is an actively bad idea because it increases the amount of crud occupying the top of talk pages, and there's definitely no consensus that substituting templates is general is to be encouraged. Chris Cunningham 13:08, 19 September 2007 (UTC)
It is not a problem to skip past the substituted code. There are edit buttons for each talk section. The crud is usually concentrated at the top of talk pages. There is a long list of required or suggested substitutions at Wikipedia:Template substitution. So obviously some substitution is encouraged. I thought that substitution lowered the server loads. I keep seeing server slowdown messages. You know, the ones about a watchlist being behind so many seconds or minutes. I know of WP:PERF, too. So how about some guidance from others. --Timeshifter 13:19, 19 September 2007 (UTC)
I'm pretty sure you need to re-read the Template substitution page and see what exactly it actually says. Not only does it explicitly link to WP:PERF itself, it also explains why it is that some templates are always substituted, and it isn't for performance reasons. Chris Cunningham 14:21, 19 September 2007 (UTC)

(unindent) Here is part of Wikipedia:Template substitution#Benefits of substitution:

  • Substituting en masse may speed up the site, though the amount and significance of this is the subject of frequent debate. Every time a page is modified, the server must get text from a separate page for every template used. Although each individual template has little effect, the vast number of templates used on Wikipedia is one factor affecting server load and article load times. Chief Technical Officer Brion Vibber (who "maintain[s] overall responsibility for all technical functions of the Foundation, including both hardware and software") has said: "'Policy' should not really concern itself with server load except in the most extreme of cases; keeping things tuned to provide what the user base needs is our job." (See Wikipedia:Don't worry about performance.)
See Wikipedia:Transclusion costs and benefits for further details.

See the next section for related questions.--Timeshifter 15:47, 19 September 2007 (UTC)

[edit] Jerusalem often loads very slowly

I think it is because of the many minor templates in that page. Any ideas?

See the talk page discussion also about the slow-loading problem. It is discussed here:

I see this in the HTML source code for the page:

Pre-expand include size: 1115797 bytes
Post-expand include size: 354264 bytes
Template argument size: 197507 bytes
Maximum: 2048000 bytes

Does that help at all? --Timeshifter 13:30, 19 September 2007 (UTC)

[edit] Template:Done

I've left a note on the templates talk page, but shouldn't this template be substed? CO2 02:35, 25 September 2007 (UTC)

[edit] Substituting multiple templates at once?

Is there a way to substitute a few templates at once, with one tag, something like

{{subst:{{CURRENTDAY}}{{CURRRENTMONTH}}{{CURRENTYEAR}}}}

? Because I can think of quite a few uses for it, but can't find one, so I'm doubting weather it exists. Thanks! Yamakiri 00:56, 26 September 2007 (UTC)

Well you can paste a bunch of text and templates into Special:ExpandTemplates to expand everyting into plain wikicode. --Sherool (talk) 10:11, 26 September 2007 (UTC)
Okay then, well it'll do. Thank you! YamakiriTC 09-26-2007•10:28:58
Use something like {{subst:DATE}}} {{DATE}} was created for this very purpose, but is just month/year. Rich Farmbrough, 09:32 27 September 2007 (GMT).
You can use {{now}} --Nukeless 10:43, 29 November 2007 (UTC)

[edit] November 2, 2007 Deletion-related edit explained

The differences and explanation respectively. – Conrad T. Pino 12:08, 2 November 2007 (UTC)

[edit] Explanation and contradiction

I'm not sure I understand why {{archivebox}} is listed as something that "must" be substituted. If it is substituted then that makes it hard to add more archives later on. Can someone explain why it should be substituted? Also, I note with some irony that the archive box on this talk page is not substituted. I think {{archivebox}} should be removed from the "must" list, and moved into the "not" list. Does this sound reasonable? I note that I am not the first to make this suggestion here, see the archive here. -- HiEv 07:27, 17 November 2007 (UTC)

[edit] Update?

It seems as though this page should get an update. I just did exactly as it says, and a lot of them got reverted. Could somoen who knows more about what should and what shouldn't update this? Thanks! Soxred93 has a boring sig 16:03, 17 November 2007 (UTC)

Axem Titanium just removed {{archivebox}} from the "must" list with the note "has been superceded by Template:Archive box which does not require substitution" in his edit summary. -- HiEv 21:16, 17 November 2007 (UTC)
Yeah, I know that. But one of the templated listed too, {{WP:RM}} was reverted. Soxred93 has a boring sig 01:39, 18 November 2007 (UTC)

[edit] Automatic substitution

Is there any way to automagically substitute a template when it must be substitued.

I.e. templatexample1 could containt subst:templatexample2. So, when user includes {{templatexemple1}} it would include (subst:) the content of templatexample2. --Nukeless 10:42, 29 November 2007 (UTC)

[edit] Unsigned

What about signing an unsigned comment? Are you supposed to subst or leave it as a template link? -- Signed by Wolverenesst c 07:11, 1 December 2007 (UTC)

It doesn't really matter. If you are adding the template it should be subst (to reduce server load)ɺ but there is no point in changing transclusions of it to substitutions.-- maelgwn - talk 04:49, 23 February 2008 (UTC)

[edit] Transclusion and substitution

I think I understand the difference between transclusion and substitution now; but IMHO this page is not very good in explaining their relationship. Would you consider it correct and helpful to add

(see: Wikipedia:Transclusion)

right after

Ordinarily, a template will be expanded "on the fly"; that is, the template code calls a separate page for the text every time someone edits a page it is used on.

? -- 790 21:03, 2 December 2007 (UTC)

[edit] This directions aren't easy to find

Actually, I fist used "subst:" when I was a rookie and was trying to create a wikiproject (which was't even my intention back then anyway). Now, years later I needed to do a template substitution but forgot how to do it. I actually came to think that it was a characteristic of certain templates "programmed" to be substituted.

The pion is, I tryed to figure out how to create a substitutable template, I wasn't able to find this help article!!

It took me long but I figured out how to use subst by finding the original example I knew from the guide to create wikiproject, which was all changed. then I searched subst in wikipedia pages.

Yuo guys need to make this help article more reachable.

--20-dude (talk) 00:33, 3 March 2008 (UTC)

I came here to say the same exact thing. I still don't know how how subst works. Maybe you could add a quick example? OptimistBen (talk) 02:48, 15 April 2008 (UTC)

[edit] Template:Copyvio

There is discussion at WT:CP regarding whether to substitute {{copyvio}} or create a subst template that includes it, in order to avoid listing at Special:Shortpages. Interested editors please comment there.--Doug.(talk contribs) 17:24, 5 March 2008 (UTC)

This has been implemented. {{copyvio}} is now always substituted.--Doug.(talk contribs) 02:54, 2 April 2008 (UTC)