Template talk:Newtemplate
Hey Robert,
Questions:
- Is this always required (on your view)?
- If not always, then when?
- What are the rationales for the different sections?
--Larry
- I think this should be on every template (except for subpage article templates, of course), in order to document its usage and instructions. Hopefully this will provide a great level of "ease of use" for all templates (and even encourage development and refinement of existing ones).
- The different sections are intended as documentation; like a "developer notes" or "instructions". Obviously there might be some times when a better or different template should be used, or in cases where you really can't use a template with existing templates. And if something goes wrong with the template, you should know who to go to to have it fixed. --Robert W King 11:32, 13 January 2008 (CST)
Newtemplate and pre-expand sizes
I just saw a number of cases where the {{Newtemplate}} caused a substantial increase in size in the resulting new templates footprint. Using an "example" seemed like it made it particularly bad. Since anything "in" the template page needs to be accessed for every call of the template, shouldn't we put all the documentation stuff on the talk page as a practice?--David Yamakuchi 02:15, 11 April 2008 (CDT)
- It shouldn't be a problem. Look at sodium. There the current numbers are:
- Pre-expand include size: 73527 bytes
- Post-expand include size: 121808 bytes
- Template argument size: 4156 bytes
- I'll revert back and check to see what they are without the newtemplate on the template. Hold on. Chris Day 02:19, 11 April 2008 (CDT)
- The numbers now, on Sodium, without the newtemplate content at the front are:
- Pre-expand include size: 70974 bytes
- Post-expand include size: 121808 bytes
- Template argument size: 4156 bytes
- The only difference is less than 3,000 bytes. A frequently used template might be a problem but the {{Periodic}} and {{Elem Infobox}} are only called once each per element page. Chris Day 02:24, 11 April 2008 (CDT)
- The numbers now, on Sodium, without the newtemplate content at the front are:
See, it does matter...a little. I'm not saying it's a problem, I'm just saying that is info for authors only and doesn't need to be loaded with every page view, right?...--David Yamakuchi 02:27, 11 April 2008 (CDT)
I thought the idea was to slap this thing on every template, period. That seems to me to be an awful lot of loading author, caveats, etc to "end users" that won't even know that they are looking at a template. IDK, seems like Talk is the place for that...no?--David Yamakuchi 02:30, 11 April 2008 (CDT)
- I don't think it is counting the expanded content just the the small amount of literal text that is there. So i don't anticipate a problem with respect to size. I agree if it was counting the expanded content too it would be a real problem. With the {{Elem Infobox}} template the main problem was solved by not calling on the {{ }} template 500 times or more.
- I would have left it on the talk page except there is the NOEDITSECTION issue, and that really does need to be part of the {{newtemplate}} otherwise the edit links go to the wrong place causing a lot of confusion. And, as you found, a talk page with no section edit links is not desirable. The alternative is to have the documentation on a subpage with a link on the main page, especially if the size issue is problematic. Chris Day 02:37, 11 April 2008 (CDT)
{{Elem Infobox}} size with newtemplate:
- Pre-expand include size: 145318 bytes
- Post-expand include size: 313728 bytes
- Template argument size: 76597 bytes
{{Elem Infobox}} size with newtemplate:
- Pre-expand include size: 67880 bytes
- Post-expand include size: 87349 bytes
- Template argument size: 5482 bytes
The fact that only 2500 bytes are added to the pre-expand size indicates that it is literally only the characters on the page that are added. None of the expanded content is counted. Or is that small amount still something to worry about? I think it is only a problem for a template that is used hundreds of times on a given page. Chris Day 02:48, 11 April 2008 (CDT)