Skip to content

Adding widgets to the sitewide frontpage

Amitai Burstein edited this page Jan 21, 2014 · 5 revisions

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:

  1. First enable the module context_ui by running in your OpenScholar root directory drush en context_ui -y or manually through admin/modules.

  2. Go to admin/structure/context, look for the context os_sitewide_front and click on edit. selection_040

  3. 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 click save to save the layout. selection_041

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/contextfor the context you want to change. selection_043

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.

Clone this wiki locally