Template:WPBannerMeta/hooks: Difference between revisions

m
added category
(Created page with '<div class="template-documentation"> '''WPBannerMeta''' incorporates a number of ''''hooks'''', where advanced or customised features can be added. These should take …')
 
m (added category)
 
Line 1: Line 1:
<div class="template-documentation">
<div class="template-documentation">
'''WPBannerMeta''' incorporates a number of ''''[[hooking|hooks]]'''', where advanced or customised features can be added. These should take the form of a subtemplate passed to the relevant hook parameter. Any relevant parameters should then be passed to the hook template{{mdash}} it may be necessary to repeat parameters that are already passed to the main template (eg: {{para|category|<nowiki>{{{category|¬}}}</nowiki>}} and {{para|class|<nowiki>{{{class|}}}</nowiki>}} are commonly used). If you write a hook that you think other projects could use, please copy or move it to a subpage here and add it to the list below. '''All hooks that are subpages of this page should be fully protected'''.
'''WPBannerMeta''' incorporates a number of ''''[[Hooking|hooks]]'''', where advanced or customised features can be added. These should take the form of a subtemplate passed to the relevant hook parameter. Any relevant parameters should then be passed to the hook template{{mdash}} it may be necessary to repeat parameters that are already passed to the main template (eg: {{para|category|<nowiki>{{{category|¬}}}</nowiki>}} and {{para|class|<nowiki>{{{class|}}}</nowiki>}} are commonly used). If you write a hook that you think other projects could use, please copy or move it to a subpage here and add it to the list below. '''All hooks that are subpages of this page should be fully protected'''.  
 
=== Writing a hook ===


===Writing a hook===
Hooks should be carefully designed to mimic the meta-functionality of the WPBannerMeta template, particularly with things like category opt-out and case-insensitive class filtering; and for ease of maintenance, the parameters should be similarly named to WPBannerMeta's default parameters.  
Hooks should be carefully designed to mimic the meta-functionality of the WPBannerMeta template, particularly with things like category opt-out and case-insensitive class filtering; and for ease of maintenance, the parameters should be similarly named to WPBannerMeta's default parameters.  


===Available hook parameters===
=== Available hook parameters ===
*{{para|HOOK_ASSESS}} – between the code for quality and importance assessments.
 
*{{para|HOOK_BOTTOM}} – just below the comments display, adjacent to {{para|BOTTOM_TEXT}}. Please use this hook rather than the {{para|BOTTOM_TEXT}} parameter, for adding extra functionality to the bottom of the template.
*{{para|HOOK_ASSESS}} – between the code for quality and importance assessments.  
*{{para|HOOK_NOTE}} – after the last note code (above the comment display).
*{{para|HOOK_BOTTOM}} – just below the comments display, adjacent to {{para|BOTTOM_TEXT}}. Please use this hook rather than the {{para|BOTTOM_TEXT}} parameter, for adding extra functionality to the bottom of the template.  
*{{para|HOOK_COLLAPSED}} – added to the 'counter' that counts the number of notes that have been triggered on a page, to prompt the collapsible box. Accepts either
*{{para|HOOK_NOTE}} – after the last note code (above the comment display).  
**any valid input to the <tt>[[mw:Help:Extension:ParserFunctions##expr:|#expr:]]</tt> ParserFunction.
*{{para|HOOK_COLLAPSED}} – added to the 'counter' that counts the number of notes that have been triggered on a page, to prompt the collapsible box. Accepts either  
**"''auto''", which automatically sets to 1 if HOOK_NOTE is non-empty and 0 otherwise. This is the default setting and is suitable if HOOK_NOTE will not normally produce more than one row of output.
**any valid input to the <tt>[[Mw:Help:Extension:ParserFunctions#.23expr:|#expr:]]</tt> ParserFunction.  
**"''auto''", which automatically sets to 1 if HOOK_NOTE is non-empty and 0 otherwise. This is the default setting and is suitable if HOOK_NOTE will not normally produce more than one row of output.  
*{{para|HOOK_IMPORTANCE}} - between the importance assessment and the autoassess notice.  
*{{para|HOOK_IMPORTANCE}} - between the importance assessment and the autoassess notice.  
*{{para|HOOK_NESTED}} – after the taskforce list that is displayed when the banner is nested within a {{tl|WikiProjectBannerShell}}.
*{{para|HOOK_NESTED}} – after the taskforce list that is displayed when the banner is nested within a {{tl|WikiProjectBannerShell}}.  
*{{para|HOOK_TF}} – after the taskforce code (just above the code for {{para|attention}}).
*{{para|HOOK_TF}} – after the taskforce code (just above the code for {{para|attention}}).


===Existing hooks===
=== Existing hooks ===
{{selfref|See also: [[Special:Prefixindex/{{FULLPAGENAME}}|Full list of hook subpages]]}}
 
*[[/aclass]] - enables an A-Class review process to be integrated into the banner.
{{selfref|See also: [[Special:Prefixindex/{{FULLPAGENAME}}|Full list of hook subpages]]}}  
*[[/bchecklist]] - enables an B-class checklist
 
*[[/cats]] &ndash; add categories based on parameters with proper optout, case insensitivity, etc.
*[[/aclass]] - enables an A-Class review process to be integrated into the banner.  
*[[/collaboration]] &ndash; enables integration of project collaboration into the banner.
*[[/bchecklist]] - enables an B-class checklist  
*[[/collapsed]] &ndash; enables adding another collapsed section.
*[[/cats]] add categories based on parameters with proper optout, case insensitivity, etc.  
*[[/notecounter]] - allows notes, etc. added in HOOK_NOTE to contribute towards the counter that triggers the notes being collapsed.
*[[/collaboration]] enables integration of project collaboration into the banner.  
*[[/notes]] &ndash; provides ten additional notes. Hooks to {{para|HOOK_NOTE}}.
*[[/collapsed]] enables adding another collapsed section.  
*[[/peerreview]] - enables peer review functions.
*[[/notecounter]] - allows notes, etc. added in HOOK_NOTE to contribute towards the counter that triggers the notes being collapsed.  
*[[/taskforces]] – provides ten additional taskforces (hooks to {{para|HOOK_TF}}).
*[[/notes]] provides ten additional notes. Hooks to {{para|HOOK_NOTE}}.  
*[[/tfnested]] – nested summaries for ten additional taskforces. Works with [[/taskforces]] above. Hooks to {{para|HOOK_NESTED}}.
*[[/peerreview]] - enables peer review functions.  
*[[/qualimpintersect]] - allows for quality and importance category intersection.
*[[/taskforces]] – provides ten additional taskforces (hooks to {{para|HOOK_TF}}).  
*[[/qualitycats]] - enables categorisation with an additional quality scale.
*[[/tfnested]] – nested summaries for ten additional taskforces. Works with [[/taskforces]] above. Hooks to {{para|HOOK_NESTED}}.  
*[[/qualimpintersect]] - allows for quality and importance category intersection.  
*[[/qualitycats]] - enables categorisation with an additional quality scale.  
*[[/todolist]] - allows for easy adding of a project wide to-do list (hooks to {{para|HOOK_BOTTOM}}).
*[[/todolist]] - allows for easy adding of a project wide to-do list (hooks to {{para|HOOK_BOTTOM}}).
</div>
</div>
<noinclude>[[Category:WPBannerMeta tracking categories]]</noinclude>
70,044

edits