Template:Templatehelp: Difference between revisions

From FrathWiki
Jump to navigationJump to search
m (What the...)
m (Hopefully debugging)
Line 5: Line 5:
If you put
If you put


   <nowiki><noinclude>{{Templatehelp}}</noinclude></nowiki>
   <nowiki><noinclude>{{Templatehelp}}</noinclude></nowiki foo=1>


at the end of your template text the text of a like-named page in the <code>Help:</code> namespace.
at the end of your template text the text of a like-named page in the <code>Help:</code> namespace.


For example the page <code>[[Help:Voweltable]]</code> will be included when you ''view'' the page <code>[[Template:Voweltable]]</code> but not when you actually ''use''
For example the page <code>[[Help:Voweltable]]</code> will be included when you ''view'' the page <code>[[Template:Voweltable]]</code> but not when you actually ''use''
  <nowiki>{{Voweltable|</nowiki>''parameters''<nowiki>}}</nowiki>
  <nowiki>{{Voweltable|</nowiki foo=2>''parameters''<nowiki>}}</nowiki foo=3>


in the body of another page.
in the body of another page.
Line 18: Line 18:
=== Why? ===
=== Why? ===


The idea of (no)including a help page in a template page is that users can see usage instructions for a template when viewing the template page, but at the same time they won't get the whole of the usage instructions included when they use <code><nowiki>{{subst:</nowiki>''templatename''}}</code>, but only the single line
The idea of (no)including a help page in a template page is that users can see usage instructions for a template when viewing the template page, but at the same time they won't get the whole of the usage instructions included when they use <code><nowiki>{{subst:</nowiki foo=4>''templatename''}}</nowiki  foo=5></code>, but only the single line


  <nowiki><noinclude>{{Templatehelp}}</noinclude></nowiki>
  <nowiki><noinclude>{{Templatehelp}}</noinclude></nowiki foo=6>


which can then easily be removed.
which can then easily be removed.
Line 29: Line 29:
=== A snag ===
=== A snag ===


I wish you shouldn't have to put <code><nowiki>{{Templatehelp}}</nowiki></code> inside <code><nowiki><noinclude>...</noinclude></nowiki></code> tags, but there seems to be no way to avoid that. As things are those tags are of course very important!
I wish you shouldn't have to put <code><nowiki>{{Templatehelp}}</nowiki foo=7></code> inside <code><nowiki><noinclude>...</noinclude></nowiki foo=8></code> tags, but there seems to be no way to avoid that. As things are those tags are of course very important!




Make sure to put
Make sure to put


  <nowiki><noinclude>{{Templatehelpnote}}</noinclude></nowiki>
  <nowiki><noinclude>{{Templatehelpnote}}</noinclude></nowiki foo=9>


at the top of your help page! (Cf. <code>[[Template:Templatehelpnote]]</code>)
at the top of your help page! (Cf. <code>[[Template:Templatehelpnote]]</code>)


</noinclude>
</noinclude></nowiki>

Revision as of 08:55, 15 November 2006


Usage

If you put

 <noinclude>{{Templatehelp}}</noinclude></nowiki  foo=1>

at the end of your template text the text of a like-named page in the <code>Help:</code> namespace.

For example the page <code>[[Help:Voweltable]]</code> will be included when you ''view'' the page <code>[[Template:Voweltable]]</code> but not when you actually ''use''
 <nowiki>{{Voweltable|</nowiki  foo=2>''parameters''<nowiki>}}</nowiki  foo=3>

in the body of another page.

If the help page has not yet been created there will appear a link to it instead of its not-yet-existing content, just as with not-yet-created templates.

=== Why? ===

The idea of (no)including a help page in a template page is that users can see usage instructions for a template when viewing the template page, but at the same time they won't get the whole of the usage instructions included when they use <code><nowiki>{{subst:</nowiki  foo=4>''templatename''}}</nowiki  foo=5></code>, but only the single line

 <nowiki><noinclude>{{Templatehelp}}</noinclude></nowiki  foo=6>

which can then easily be removed.

The idea behind <code>[[Template:Templatehelp]]</code> itself
is of course to avoid inconsitency in the naming of templates and their related help pages.

=== A snag ===

I wish you shouldn't have to put <code><nowiki>{{Templatehelp}}</nowiki  foo=7></code> inside <code><nowiki><noinclude>...</noinclude></nowiki  foo=8></code> tags, but there seems to be no way to avoid that. As things are those tags are of course very important!


Make sure to put

 <nowiki><noinclude>{{Templatehelpnote}}</noinclude></nowiki  foo=9>

at the top of your help page! (Cf. <code>[[Template:Templatehelpnote]]</code>)

</noinclude>