Options does not show in layout builder or in paragraphs layout module

Created on 1 April 2023, over 1 year ago
Updated 27 January 2024, 9 months ago

Recently I have installed layout options module But no options shown in either layout builder UI in drupal . also tried with layout_paragraphs module .

I have custom layout registered.
and also added my_module.layout_options.yml

First i tried with options ui module . it did not work.
then i added class in my layout definition according to module documentation. did not worked either .

Drupal version : 10
layout_options : 1.2
php : 8.1
mariadb : 10.6

--mymodule.layouts.yml

mymodule_layouts_one_column:
  label: 'One Column'
  category: 'mymodule Layouts'
  path: layouts/one_column
  template: one-column
  class: '\Drupal\layout_options\Plugin\Layout\LayoutOptions'
  library: mymodule_layouts/one_column
  regions:
    column_one:
      label: column one 
  icon_map:
    - [column_one]

mymodule_layouts_two_column:
  label: 'Two Column'
  category: 'mymodule Layouts'
  path: layouts/two_column
  template: two-column
  class: '\Drupal\layout_options\Plugin\Layout\LayoutOptions'
  library: mymodule_layouts/two_column
  regions:
    column_one:
      label: column one
    column_two:
      label: column two
  icon_map:
    - [column_one, column_two]

mymodule_layouts_three_column:
  label: 'Three Column'
  category: 'mymodule Layouts'
  path: layouts/three_column
  template: three-column
  class: '\Drupal\layout_options\Plugin\Layout\LayoutOptions'
  library: mymodule_layouts/three_column
  regions:
    column_one:
      label: column one
    column_two:
      label: column two
    column_three:
      label: column three      
  icon_map:
    - [column_one, column_two, column_three]

mymodule_layouts_four_column:
  label: 'Four Column'
  category: 'mymodule Layouts'
  path: layouts/four_column
  template: four-column
  class: '\Drupal\layout_options\Plugin\Layout\LayoutOptions'
  library: mymodule_layouts/four_column
  regions:
    column_one:
      label: column one
    column_two:
      label: column two
    column_three:
      label: column three
    column_four:
      label: column four     
  icon_map:
    - [column_one, column_two, column_three, column_four]

and mymodule_layouts_layout_options.yml

# This is an example of a [provider].layout_options.yml file.
# Replace provider with your module or theme name.
# This should be in the root directory of your module or theme.
# The settings here only apply if the layouts are using the 
# \Drupal\layout_options\Plugin\Layout\LayoutOptions layout plugin.
#

#
# This section defines the options that are available to configure layouts
#
layout_option_definitions:
  #
  # This defines an id attribute option using the layout_options_id plugin.
  #
  layout_id:
    title: 'Id attribute'
    description: 'The CSS identifier to use on this layout item.'
    default: ''
    plugin: layout_options_id
    layout: true
    regions: true
    weight: -100  #optional attribute to set form location.


  layout_bg_color:
    title: 'Background color'
    description: 'The background color to use with this layout item.'
    default: ''
    plugin: layout_options_class_select
    multi: false
    options:
      bg-info: 'Info'
      bg-primary: 'Primary'
      bg-secondary: 'Secondary'
      bg-success: 'Success'
      bg-white: 'White'
      bg-transparent: 'Transparent'
    layout: true
    regions: true
    weight: -90


  layout_design_classes:
    title: 'Layout classes'
    description: 'The theme design classes to use with this layout item.'
    default: ''
    plugin: layout_options_class_checkboxes
    inline: true
    options:
      layout--no-spacing: 'No Padding/Margin'
      layout--narrow-spacing: 'Narrow spacing'
      layout--small-width-image: 'Small Width Image'
      layout--full-width-img: 'Full Width Image'
    layout: true
    regions: true


  layout_custom_classes:
      title: 'Custom classes'
      description: 'Any custom classes to use with this layout item.'
      default: ''
      plugin: layout_options_class_string
      layout: true
      regions: true


layout_options:

  global:

    layout_bg_color: {}
    layout_custom_classes: {}
    layout_id: {}
  
  

Is there anything i have done wrong

💬 Support request
Status

Closed: cannot reproduce

Version

1.2

Component

Documentation

Created by

🇧🇩Bangladesh ron.du

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @ron.du
  • Status changed to Postponed: needs info over 1 year ago
  • 🇫🇷France Grimreaper France 🇫🇷

    Hi,

    Thanks for the detailed explanations.

    Regarding the layout.yml and layout_options.yml files, they seem ok.

    This may be due to the module not installed or path to files or a custom code interfering or another contrib module interfering?

    Have you tried with layouts from a public design system theme like UI Suite Bootstrap to ensure that Layout Options is correctly installed?

    Layout Options UI is not required.

  • 🇧🇩Bangladesh ron.du

    THank you for reading this issue.

    This may be due to the module not installed or path to files or a custom code interfering or another contrib module interfering?

    In fact module is installed . and i tried also with fresh drupal install . First with only with layout_discovery layouts ( using ui module ) . then with my custom layout definition ( which is very simple indeed )

    Have you tried with layouts from a public design system theme like UI Suite Bootstrap to ensure that Layout Options is correctly installed?

    No i have not tried other modules . I will try your suggested theme today

    It seems only i have this problem even after trying several times

  • 🇫🇷France Grimreaper France 🇫🇷

    Hi,

    Any news on this issue?

  • Status changed to Closed: cannot reproduce 9 months ago
  • 🇫🇷France Grimreaper France 🇫🇷

    Hi,

    Closing as there is no activity.

    Feel free to re-open if needed.

Production build 0.71.5 2024