-
Notifications
You must be signed in to change notification settings - Fork 2
Adding widgets to the sitewide frontpage
The control over blocks in a page can be done in Drupal through the Context module. The module allows control of which blocks will appear on a page according to the context being viewed. A context can be assigned to a piece of content or a path for example. In order to add widgets and blocks to the sitewide frontpage, we need to alter its context. This is done by following the following steps:
-
First enable the module
context_ui
by running in your OpenScholar root directorydrush en context_ui -y
or manually throughadmin/modules
. -
Go to
admin/structure/context
, look for the contextos_sitewide_front
and click onedit
. -
On the next page press on the
blocks
link. This opens the current layout for the sitewide frontpage context, i.e. the set of blocks and their position for that page. After changes are made clicksave
to save the layout.
Note: Changing the layout and saving will change the layout but for the changes to persist you must export the changes made in the DB to code. This is done by pressing the export
link in admin/structure/context
for the context you want to change.
See for example this function that alters the default configuration in order to add custom blocks, as seen here
Make sure to disable os_front
before enabling iqss_projects_front
- as there should be only a single module defining or altering the os_sitewide_front
context.