Output hooks let you inject custom HTML, CSS, and JavaScript into specific locations of the Mumara Campaigns interface without touching core templates. Unlike module hooks, which react to events, output hooks return a string that is concatenated (via hook_get_output()) and rendered when the page displays. Callbacks receive a $vars array with context such as route, user, and request.
The main injection points:
Document — HeadTop/HeadEnd for meta tags and stylesheets, BodyTop/BodyEnd for loaders and scripts (analytics, chat widgets).
Navigation — PrimaryMenu for sidebar items, TopNav, and BreadcrumbNav.
Page sections — alerts and AlertBar for banners, TitleBar, ContentEnd, and Footer.
Page-specific — addPageHtml (usually combined with a route check), SocialLogin on the login page, automation-form hooks such as AutomationCreateBroadcast and AutomationUserSettingsTab, and domain/SMTP page hooks like NodesListingPageOutput and ContactListActions.
Best practices from the reference: check $vars['route'] so you don't render on every page; always return an empty string (never null) when nothing applies; escape user data with htmlspecialchars(); load large scripts from external files rather than inline; and use priorities (1–3 critical, 5–10 standard, 10+ dependent content) to control rendering order within a hook.