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/HeadEndfor meta tags and stylesheets,BodyTop/BodyEndfor loaders and scripts (analytics, chat widgets).Navigation —
PrimaryMenufor sidebar items,TopNav, andBreadcrumbNav.Page sections —
alertsandAlertBarfor banners,TitleBar,ContentEnd, andFooter.Page-specific —
addPageHtml(usually combined with a route check),SocialLoginon the login page, automation-form hooks such asAutomationCreateBroadcastandAutomationUserSettingsTab, and domain/SMTP page hooks likeNodesListingPageOutputandContactListActions.
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.
