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.

Available Content Hooks

Hook Name
Parameters
stylesheets
SiteInfoDatabase
site
SiteInfoDatabase_TableList
site
SiteInfoDatabase_TableList_TableListRow[Connect]:Before
site
SiteInfoOverview
site
SiteInfoOverview:Before
site
SiteInfoOverview_TableList
site
SiteInfoOverview_TableList:Before
site
SiteInfo_TabNav_Items
site
SiteInfo_Top_TopRight
SitesSidebar_SitesSidebarSites:Before
SitesSidebar_SitesSidebarSites
SiteInfoSSL
site
SiteInfoSSL_TableList
site
SiteInfoUtilities
site
SiteInfoUtilities_TableList
site
routesRoot
Accepts React Router <Route /> components
routes[main]
Accepts React Router <Route /> components
routes[site-info]
Accepts React Router <Route /> components

Examples

Adding a React Component (source)

1
hooks.addContent('SiteInfoOverview', (site) => {
2
return (
3
<Notes key="notes" site={site} />
4
);
5
});
Copied!
Content Hooks are added to an array of React Components. This means all components need to have a key prop.

Adding a Route (source)

1
hooks.addContent('routesSiteInfo', () => {
2
return (
3
<Route
4
key="site-info-stats"
5
path="/site-info/:siteID/stats"
6
component={SiteInfoStats}
7
/>
8
);
9
});
Copied!

Environment Content Hooks

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]
Last modified 7mo ago