Template:WPBannerMeta/hooks

From Dodge Wiki
Jump to navigation Jump to search

WPBannerMeta incorporates a number of '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 – it may be necessary to repeat parameters that are already passed to the main template (|category={{{category|¬}}} and |class={{{class|}}} 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

Hooks should be designed with some care to mimic the meta-functionality of WPBannerMeta, particularly things like category optout and case-insensitive class filtering; and should try to retain similar parameter names to WPBannerMeta's default parameters for ease of maintenance.

Available hook parameters

  • |HOOK_NESTED= – after the taskforce list that is displayed when the banner is nested with |nested=yes.
  • |HOOK_ASSESS= – between the code for quality and importance assessments. (See /priorityscale)
  • |HOOK_IMPORTANCE= - between the importance assessment and the autoassess notice.
  • |HOOK_TF= – after the taskforce code (just above the code for |attention=
  • |HOOK_NOTE= – after the last note code (above the comment display)
  • |HOOK_BOTTOM= – just below the comments display, adjacent to |BOTTOM_TEXT=. Please use this hook rather than the |BOTTOM_TEXT= parameter, for adding extra functionality to the bottom of the template.
  • |HOOK_COLLAPSED= – inside the collapsed section, underneath all the collapsible notes.

Existing hooks

full list of subpages
  • /aclass - enables an A-Class review process to be integrated into the banner.
  • /cats – add categories based on parameters with proper optout, case insensitivity, etc.
  • /nocommentscat - enables categorisation when the article doesn't have any notes.
  • /notes – provides five additional notes. Hooks to |HOOK_NOTE=.
  • /peerreview - enables peer review functions.
  • /priorityscale - use "marked as top-priority" rather than "top-importance"
  • /taskforces – provides ten additional taskforces (hooks to |HOOK_TF=).
  • /tfnested – nested summaries for ten additional taskforces. Works with /taskforces above. Hooks to |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 |HOOK_BOTTOM=).