Content Hooks

Content Hooks allow you to inject React components into various location in Local’s UI. With Content Hooks you can do anything from adding additional buttons, table rows, or even new pages and routes.

Hook NameParameters
stylesheets
SiteInfoDatabasesite
SiteInfoDatabase_TableListsite
SiteInfoDatabase_TableList_TableListRow[Connect]:Beforesite
SiteInfoOverviewsite
SiteInfoOverview:Beforesite
SiteInfoOverview_TableListsite
SiteInfoOverview_TableList:Beforesite
SiteInfo_TabNav_Itemssite
SiteInfo_Top_TopRightsite siteStatus
SitesSidebar_SitesSidebarSites:Before
SitesSidebar_SitesSidebarSites
SiteInfoSSLsite
SiteInfoSSL_TableListsite
SiteInfoUtilitiessite
SiteInfoUtilities_TableListsite
routesRootAccepts React Router \<Route /> components
routes\[main]Accepts React Router \<Route /> components
routes\[site-info]Accepts React Router \<Route /> components
hooks.addContent('SiteInfoOverview', (site) => {
    return (
        <Notes key="notes" site={site} />
    );
});

Content Hooks are added to an array of React Components. This means all components need to have a key prop.

hooks.addContent('routesSiteInfo', () => {
    return (
        <Route 
            key="site-info-stats" 
            path="/site-info/:siteID/stats" 
            component={SiteInfoStats}
        />
    );
});

The following Content Hooks are meant to be used by Environments such as the Preferred and Custom Environment.

ENV_ID and ENV_VERSION are for illustrative purposes only and should be replaced with a static value or variable.

ENV_ID and ENV_VERSION are in the hook name to allow for multiple Environments to be loaded at the same time and to cut down on the number of conditionals required.

Hook Name
NewSiteEnvironment[ENV_ID][ENV_VERSION]_AddSiteContent_Inner
SaveBlueprintPage[ENV_ID][ENV_VERSION]_SettingsPane_TableList
SettingsNewSiteDefaults[ENV_ID][ENV_VERSION]
SiteInfoEnvironmentMySQL[ENV_ID][ENV_VERSION]
SiteInfoEnvironmentPHP[ENV_ID:ENV_VERSION]
SiteInfoEnvironmentWebServer[ENV_ID][ENV_VERSION]