Template:Hatnote/doc: Difference between revisions

Content deleted Content added
→‎Function: Added hat note
m 165 revisions imported from wikipedia:Template:Hatnote/doc
 
(18 intermediate revisions by 13 users not shown)
Line 1:
{{hatnote|text}}1,
{{Documentation subpage}}
{{High-use| 369726 }}
{{Never substitute}}
{{shortcut|T:HAT}}
{{lua|Module:Hatnote}}
 
Line 9 ⟶ 8:
{{hatnote|Example hatnote text.}}
 
Broadly speaking, a hatnote should answer a readersreader's question (maybe preemptively): ''Am I on the right page?''
 
{{TOC limit}}
Line 21 ⟶ 20:
 
== Usage ==
 
; Basic usage:
{{hatnote|''text''}}
Line 29 ⟶ 27:
 
== Parameters ==
 
This template accepts the following parameters:
* <code>1</code> - the hatnote text (required)
* <code>extraclasses</code> - any extra CSS classes to be added, - Forfor example, the {{tl|see also}} template adds the classes "{{para|extraclasses|boilerplate seealso}}".
* <code>selfref</code> - If set to "yes", "y", "true" or "1", adds the CSS class "selfref". This is used to denote self-references to Wikipedia. See [[Template:Selfref]] for more information.
* <code>category</code> - If set to "no", "n", "false", or "0", suppresses the error tracking category ([[:Category:Hatnote templates with errors]]). This has an effect only if the <!--"first-positional parameter", not "first positional parameter", if you value the readers' time ... but better yet --> leftmost parameter (the hatnote text) is omitted.
 
== Example ==
 
* <code><nowiki>{{hatnote|Example hatnote text}}</nowiki></code> → {{hatnote|Example hatnote text}}
 
== Errors ==
 
If no hatnote text is supplied, the template will output the following message:
* {{hatnote|category=no}}
Line 56 ⟶ 51:
 
== Technical details ==
 
The HTML code produced by this template looks like this:
 
* <code><nowiki><{{tag|div |attribs=role="note" class="hatnote navigation-not-searchable"></nowiki>''|link=yes|content= hatnote text''<nowiki></div></nowiki></code>}}
 
The code is produced by [[Module:Hatnote]].
 
==See also==
* {{tl|For}}
 
{{Hatnote templates}}
Line 93 ⟶ 90:
}
</templatedata>
{{Collapse bottom}}<includeonly>{{#ifeq:{{SUBPAGENAME}}|sandboxSandbox other||
[[Category:Hatnote templates| ]]
[[Category:Cross-reference templates]]