Templates Wiki

Editing

Template layout

1
  • The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit. If you are undoing an edit that is …
Latest revision Your text
Line 4: Line 4:
   
 
==Procedure==
 
==Procedure==
Put the template code on the main page, and put all documentation and categories on a <tt>/doc</tt> subpage.
+
Put the template code on the main page, and put all documentation and categories on a /doc subpage.
   
 
This means that updates to the documentation do not result in large numbers of pointless template updates across the wiki, and the template itself can be protected if necessary (without protecting the documentation).
 
This means that updates to the documentation do not result in large numbers of pointless template updates across the wiki, and the template itself can be protected if necessary (without protecting the documentation).
Line 83: Line 83:
 
Note that the above example also uses the [[Template:T]] template.
 
Note that the above example also uses the [[Template:T]] template.
   
=== Why not use a separate documentation subpage? ===
+
=== Why not use a separate documentation page? ===
 
While using a documentation subpage (<tt>Template:''templatename''/doc</tt>) has become standard practice, it is really only better when the documentation is large or has many examples. For smaller, simpler templates with light documentation needs, including the documentation on the template page itself can be faster and more self-contained. Remember, using a <tt>/doc</tt> subpage for documentation usually implies the need to use the {{t|Documentation}} template which automatically adds a dependency on another template (which ironically, is usually undocumented). Also, the use of categories can be far more confusing when using a transcluded <tt>/doc</tt> subpage in a template page.
 
While using a documentation subpage (<tt>Template:''templatename''/doc</tt>) has become standard practice, it is really only better when the documentation is large or has many examples. For smaller, simpler templates with light documentation needs, including the documentation on the template page itself can be faster and more self-contained. Remember, using a <tt>/doc</tt> subpage for documentation usually implies the need to use the {{t|Documentation}} template which automatically adds a dependency on another template (which ironically, is usually undocumented). Also, the use of categories can be far more confusing when using a transcluded <tt>/doc</tt> subpage in a template page.
   
  Loading editor