Anchors are places in the Secretary code that allow plugins to add functionality or modify data at runtime. Here is a full list of all anchors included in official Secretary code (including modules).

You will find the name of each anchor (to use with hook()), where it is called (backend, frontend or both) and a brief description. Some anchors provide a variable that is sent to the function hooking into it.

Core anchors

start
backend (index.php)
Called before any HTML output.

head_tags
backend (index.php) → <head>
Allows plugins to add HTML tags to the <head>.

css
backend (index.php) → <head>
Allows plugins to add directly to the CSS block of the <head>.

javascript
backend (index.php) → <head>
Allows plugins to add directly to the Javascript block of the <head>.

menu
backend (assistants/office.php)
Primarily for modules to register their menu with the system. Plugins can of course add directly to the menu with this anchor.

menuModify
backend (assistants/office.php)
value: $menu array
This is a flexible anchor, letting plugins gain access to the entire menu array so that modifications can be made to it (renaming, reordering, adding/subtracting, etc).

after_menu
backend (index.php) → div#nav
Called after the menu has been outputted.

breadcrumbActive
backend (index.php) → div#title h1 span.active
This is the title of the post being edited. An example of this is when editing a project, the project's title is displayed at the top of the page in the blue header (“Projects / Manage / Solar”).

big_message
backend (index.php) → div#formMessage
Primarily for functions that deal with form submission, this area can be used to display success and error messages. Other uses could be to alert users to important information (“update settings now!”) or similar.

content_start
backend (index.php) → div#app
Called at the very start of the actual app area before anything else (where forms and all other content appear).

before_form
backend (index.php) → div#app
Same as content_start but called afterwards - allows plugins to split tasks into a visual hierarchy.

form_process
backend (index.php) → function process()
Hooks into the form processing action, after the form has been submitted by the user.

form_submit_primary
backend (index.php) → div.formButtons div.primary
Lets modules/plugins add submit buttons to the form. “Primary” buttons are listed first in the button row and are given extra visual weight (in the default backend skin, they are 150px wide). This is meant for “primary” actions such as save, update etc.

form_submit_secondary
backend (index.php) → div.formButtons div.secondary
Lets modules/plugins add submit buttons to the form. “Secondary” buttons are listed last in the button row and are displayed smaller than their “primary” counterparts. “Secondary” buttons are for actions such as delete or cancel.

form_main
backend (index.php) → div#app
This is the anchor that all functions adding to the form must hook into.

after_form
backend (index.php) → div#app
Called right after the form has been generated and outputted.

end
backend (index.php) → body
Called at the end of the page, right before the closing </body> and </html> tags.

simplename_modify
backend (assistants/clerk.php) → function simple_name()
The simple_name() function is used quite often within The Secretary, for generating URL-friendly titles and ID names aka “slugs”. This anchor lets plugins modify the slug before the function modifies it. An example use is a plugin that converts the Danish characters æ, ø, å to their English/simplified equivalents, ae, oe, aa.