1 layout.module layout_flexible_tempstore_load($flexible_template_name = NULL)

Get a flexible template currently being edited from the tempstore.

If a template is not yet being edited, the template will be loaded from configuration.


string $flexible_template_name: The machine name of the flexible template to load.

Return value

LayoutFlexibleTemplate: The flexible template object.


core/modules/layout/layout.module, line 2298
The Layout module creates pages and wraps existing pages in layouts.


function layout_flexible_tempstore_load($flexible_template_name = NULL) {
  if (!$flexible_template_name) {
    return new LayoutFlexibleTemplate();

  $caches = &backdrop_static(__FUNCTION__, array());
  if (!isset($caches[$flexible_template_name])) {
    if (!$item = tempstore_get('layout.flexible', $flexible_template_name)) {
      $item = layout_flexible_template_load($flexible_template_name);
    $caches[$flexible_template_name] = $item;

  return $caches[$flexible_template_name];