How can I make a custom layout with the Display Suite module in Drupal 8?
I checked the example for Drupal 8, but that didn't work for me.
Could anyone help me?
How can I make a custom layout with the Display Suite module in Drupal 8?
I checked the example for Drupal 8, but that didn't work for me.
Could anyone help me?
In your theme folder, create a THEMENAME.layouts.yml file:
clean_empty:
label: Clean empty page layout
category: Display Suite
class: '\Drupal\ds\Plugin\DsLayout'
type: partial
template: templates/nodes/clean-empty
regions:
title:
label: Title
ds_content:
label: Content
Then just create your twig file. In this example, create a clean-empty.html.twig file inside THEME/templates/nodes:
{#
/**
* @file
* Custom display suite layout
*
* Available variables:
* - title
* - ds_content: content region
*/
#}
{{ title_suffix.contextual_links }}
<h1>{{ title }}</h1>
{{ ds_content }}