You are here

function hook_display_cache_cache_keys_alter in Display Cache 7

Alters the keys to build a cid.

Use this alteration to edit the context of cached entities.

Parameters

array $keys: Array of keys. Used to build the cache id.

See also

drupal_render_cid_create()

drupal_render_cid_parts()

1 invocation of hook_display_cache_cache_keys_alter()
display_cache_get_cache_keys in ./display_cache.module
Returns array of given keys for caching.

File

./display_cache.api.php, line 23
Hooks provided by the Display Cache module.

Code

function hook_display_cache_cache_keys_alter(&$keys) {

  // Add a 'foo' context to all nodes.
  if ($keys['entity_type'] === 'node') {
    $keys['my_new_context'] = 'foo';
  }
}