localgovdrupal / localgov_subsites_extras

GNU General Public License v2.0
0 stars 0 forks source link

Subsites cache context #24

Closed Polynya closed 5 days ago

Polynya commented 1 month ago

Add cache context for subsites, for example, so that blocks can be cached separately for the main website and a subsite:

/**
 * Implements hook_block_view_BASE_BLOCK_ID_alter().
 */
function example_block_view_system_branding_block_alter(array &$build, BlockPluginInterface $block) {
  $build['#cache']['contexts'][] = 'subsites';
}
Polynya commented 1 month ago

https://github.com/localgovdrupal/localgov_subsites_extras/pull/23

markconroy commented 5 days ago

The attached PR is merged, so closing this issue.