Is there a way to remove some or all of the default layouts that DS has?

CommentFileSizeAuthor
#12 1132682-11.patch5.61 KBaspilicious
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

swentel’s picture

Well, the easiest way is an alter hook before all layouts are returned (easy, takes 5 minutes) or even an interface to select layouts you only want to make available (easy too, but takes some time). So hook and/or UI, all good for me, will try to come up with a patch somewhere this week.

edward_or’s picture

A hook sounds awesome to me! Thank you very much.

swentel’s picture

Status: Active » Fixed

Alright, dev now has an alter hook, e.g.

/**
 * Implements hook_ds_layout_info_alter().
 */
function hook_ds_layout_info_alter(&$layouts) {
  unset($layouts['ds_2col']);
}
edward_or’s picture

Works as described. Thanks again.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

LewisNyman’s picture

Version: 7.x-1.x-dev » 8.x-2.x-dev
Issue summary: View changes
Status: Closed (fixed) » Active

Hi, is this available in 8.x? It's implemented by ds_extras but not documented in ds.api.php.

swentel’s picture

Well, layouts are discovered through layout_plugin module, which should have an alter, so you can remove them there normally.

aspilicious’s picture

Title: Remove default layouts » Fix implementation of hook_ds_layout_info_alter()
Status: Active » Needs work

We use the layout plugin module now.

Looking at this code, the hook should be "hook_layout_alter(&$plugin_definitions)"
http://cgit.drupalcode.org/layout_plugin/tree/src/Plugin/Layout/LayoutPl...

The drush command is also broken, my colleague is working on that next week.

swentel’s picture

Novitsh’s picture

Updating metadata, relating issue from #9.

aspilicious’s picture

Status: Needs work » Needs review

Let's see what bot thinks...

aspilicious’s picture

FileSize
5.61 KB
aspilicious’s picture

Status: Needs review » Fixed

  • aspilicious committed b822f5b on 8.x-2.x
    Issue #1132682 by aspilicious: Fix implementation of...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.