Knowledge (XXG)

:Avoid using meta-templates - Knowledge (XXG)

Source 📝

233:, a proposal was made to use a meta-template. In this area, it is much better to decide on a common look and format, document that standard for easy reference in case new related templates are needed, and then implement it across the few templates being used. When changes are needed, this gives one central place for discussion and revision. After there is consensus for the change, interested editors can quickly apply them. Creating a page which displays each template also helps to locate templates which don't follow the agreed upon format. 85: 32: 243:
classes could be added to the site's global stylesheets. The meta-templates could then be replaced with the CSS classes in relevant pages. This would accomplish the same purpose — maintaining uniform style across the site — without placing a burden on the server. This also allows the visual style to
105:
While they can be extremely useful and convenient, it is proposed that they be avoided due to concerns that may not be immediately obvious: Meta-template schemes can be fragile and hard for new editors to understand. They may also provide an avenue for mass-vandalism and impact maintenance efforts.
119:
Nested template schemes are complex and prohibitively difficult for the average editor to grasp. This is particularly true in non-technical areas where the subject expert, who knows best what information should be presented in a template, is not able to edit the template due to the use of esoteric
161:
Thus, caution is warranted for those nested templates which are widely used indirectly. A sub-sub-sub-template could be vandalised with offensive content. These could be difficult to notice immediately, because the sub-template is not edited often and appears on only one or a few Watchlists, and
136:
Template links created by meta-templates also frequently cause problems for template namespace maintenance. If a Template:A is in use on several pages, but then is changed to either add or remove Template:B, any article-level template links to "B" are not updated until each article is edited or
132:
When a page is edited, a list of all templates in use on that page is stored in the database. This list can be seen when in edit mode as a list of links at the bottom. Not only are the templates that are directly called listed there, but any higher-level meta-templates as well. This feature was
202:
which have been set - are sometimes created by users who are unfamiliar with the better alternatives. Conditionals should generally be avoided, unless there is a significant advantage in their use. If they must be used, then the following methods for conditional logic are available and highly
157:
vector, since changing it or any component used in it would flush a substantial percentage of the site caches, which are critical to site performance and normally serve some 75–80% of all hits. Making even one subtle change, like the addition of a space, causes the effect.
165:
It should remembered, however, that it is possible and useful to write a meta-template which will only be used on a few or even a few hundred pages. Conversely, there are templates, such as cross-reference templates, which are very widely used without being meta-templates.
120:
coding. As a result, routine maintenance and changes are neglected, improper usage can proliferate, and innovation suffers. The solution, meant to become an easy replacement, becomes more difficult than the function it was meant to improve. Clear article source
313:
Is the desired effect only achievable through a meta-template, or can a template of basically the same appearance be made without them? If the same effect can be achieved differently, without significantly more trouble, a meta-template should be
133:
created as a helpful aid for editors, in order that they can easily tell what templates are being used on a page in case they want to edit one of them. Meta-templates clutter this list, making it unclear to editors exactly which link is correct.
182:, so that they can only be edited by administrators. If the meta-template is rarely changed, then any daughter templates probably don't change either, so it may make sense to move the formatting into the daughter templates. This was done with 321:
You should not use meta-templates without good reason. If you do create one, be open to other methods which achieve the same end, and be prepared to trade functionality in favor of avoiding the problems with meta-templates.
216:-- Provides a framework for conditional statements within templates. Since it is built into the MediaWiki code, it is relatively efficient on the back-end, but can be very complex for non-technical editors. 124:
clear template source are most preferred, though it is understandable if complex code is moved to the template. If this is the case, steps should be taken to reduce complexity to a minimum.
253:— Some templates and categories are used with the goal of helping editors find articles under a specific topic area of interest. For this use, it is often more valuable to create a 210:-- This method is very common and designed to display default alternative text only if a particular parameter is -not- set. Very simple, but not very powerful for complex needs. 282:, thus eliminating the second template call. Of course, this means that when the meta-template is changed, the daughter templates won't update, and won't be tracked by the 94:
allow certain standard text to be included on many pages, usually with the idea that in the future, any changes to that text block can be changed in one place. The term "
262: 336: 50: 261:
already maintain an area for reporting articles that need work. (Note that categories also heavily load the servers, for similar reasons.) See
137:"touched". Since the links can't be fully trusted, template maintenance work which relies on that information is made difficult or impossible. 372: 183: 54: 39: 310:
Is the template likely to be high-profile? High-profile templates cause more server load, and so are less appropriate for meta-templates.
331: 271: 142: 198:
Schemes using layers of nested templates to mimic conditional expressions — to selectively hide or show text or images based on the
286:
feature. This is a good solution for any template that doesn't change often or where the exact text need not be kept up-to-date on
187: 341: 307:
to Knowledge (XXG), or is it a primarily decorative feature? Even useful templates should be weighed against the problems above.
239:— Some meta-templates serve only to produce a specific visual format — such as size, position, color. If these were identified, 175: 377: 91: 49:
for its implementation was not established within a reasonable period of time. If you want to revive discussion, please use
98:", as used in this article, refers to nested templates which are created and used to add functions or formatting to other 356: 351: 230: 317:
Will later editors understand how this works? On the other hand, will later editors understand the alternative method?
179: 17: 258: 154: 240: 46: 249: 63: 207: 283: 199: 254: 138: 346: 213: 366: 174:
Because of vandalism and the potential server load problems described above, several
279: 153:
Any template which is used on a very high percentage of pages is an excellent
84: 106:
The reasons listed on this page argue against using meta-templates.
299:
If you are considering using a meta-template, ask these questions:
186:, which now no longer use a meta-template scheme. Remember also: 26: 83: 71: 274:
copies the template's text to any daughter templates(
141:
rely on those links as well, such as when performing
263:
Knowledge (XXG):Categories, lists, and series boxes
18:Knowledge (XXG):Meta-templates considered harmful 257:, which can be annotated and prioritized. Many 337:Knowledge (XXG):Transclusion costs and benefits 8: 162:difficult to track down in a timely manner. 145:or migrating from one template to another. 203:preferred over using nested templates: 188:meta:Protected pages considered harmful 332:Category:Knowledge (XXG) metatemplates 7: 229:— To give an example in the case of 227:Design, document, and then implement 342:Knowledge (XXG):High-risk templates 25: 373:Knowledge (XXG) failed proposals 357:Knowledge (XXG):Qif conditionals 30: 352:Knowledge (XXG):HiddenStructure 278:itution) rather than causing a 231:Knowledge (XXG):Sister projects 1: 248:Use lists, not templates or 394: 61: 244:be personally customized. 378:Knowledge (XXG) archives 155:denial-of-service attack 53:or initiate a thread at 295:Still want to use them? 176:high-use meta-templates 88: 272:Template substitution 143:Template substitution 87: 303:Is the end product 359:(see page history) 89: 347:m:ParserFunctions 214:m:ParserFunctions 208:Parameter default 92:Template messages 82: 81: 16:(Redirected from 385: 74: 55:the village pump 34: 33: 27: 21: 393: 392: 388: 387: 386: 384: 383: 382: 363: 362: 328: 297: 284:What links here 268:Use {{subst: }} 237:Make use of CSS 223: 196: 178:have had to be 172: 151: 130: 117: 112: 110:Harmful effects 78: 77: 70: 66: 58: 31: 23: 22: 15: 12: 11: 5: 391: 389: 381: 380: 375: 365: 364: 361: 360: 354: 349: 344: 339: 334: 327: 324: 319: 318: 315: 311: 308: 296: 293: 292: 291: 277: 265: 245: 234: 222: 219: 218: 217: 211: 195: 192: 184:stub templates 171: 168: 150: 147: 139:Automated bots 129: 128:Template links 126: 116: 113: 111: 108: 96:meta-templates 80: 79: 76: 75: 67: 62: 59: 45: 44: 35: 24: 14: 13: 10: 9: 6: 4: 3: 2: 390: 379: 376: 374: 371: 370: 368: 358: 355: 353: 350: 348: 345: 343: 340: 338: 335: 333: 330: 329: 325: 323: 316: 312: 309: 306: 302: 301: 300: 294: 289: 285: 281: 275: 273: 269: 266: 264: 260: 256: 252: 251: 246: 242: 238: 235: 232: 228: 225: 224: 220: 215: 212: 209: 206: 205: 204: 201: 193: 191: 189: 185: 181: 177: 169: 167: 163: 159: 156: 148: 146: 144: 140: 134: 127: 125: 123: 114: 109: 107: 103: 101: 97: 93: 86: 73: 69: 68: 65: 60: 56: 52: 51:the talk page 48: 43: 41: 36: 29: 28: 19: 320: 304: 298: 287: 280:transclusion 267: 259:WikiProjects 247: 236: 226: 221:Alternatives 197: 194:Conditionals 173: 164: 160: 152: 135: 131: 121: 118: 104: 99: 95: 90: 37: 367:Categories 250:categories 200:parameters 170:Protection 115:Complexity 38:This is a 180:protected 149:Vandalism 100:templates 47:Consensus 42:proposal. 326:See also 314:avoided. 64:Shortcut 305:useful 72:WP:AUM 40:failed 290:page. 288:every 276:subst 255:list 241:CSS 122:and 369:: 270:— 190:. 102:. 57:. 20:)

Index

Knowledge (XXG):Meta-templates considered harmful
failed
Consensus
the talk page
the village pump
Shortcut
WP:AUM

Template messages
Automated bots
Template substitution
denial-of-service attack
high-use meta-templates
protected
stub templates
meta:Protected pages considered harmful
parameters
Parameter default
m:ParserFunctions
Knowledge (XXG):Sister projects
CSS
categories
list
WikiProjects
Knowledge (XXG):Categories, lists, and series boxes
Template substitution
transclusion
What links here
Category:Knowledge (XXG) metatemplates
Knowledge (XXG):Transclusion costs and benefits

Text is available under the Creative Commons Attribution-ShareAlike License. Additional terms may apply.