Custom theme contextual links not appearing in Layout page for placed blocks

Created on 19 October 2023, 9 months ago

Hi,

First of all, I'm sorry if this goes in another place or it needs another categoritation I'm kinda new on the forum,

Problem/Motivation

Basically, I created a custom theme based on claro core theme, I did add all the dependencies and loaded jquery with drupal forms and such, the thing is, first of all I'm getting a lot of console errors saying I'm missing drupalSetSummary function and drupalGetSummary function and they do not exists,

Also, I can't see any contextual links in those blocks, I tried adding the {{ title_prefix }} {{ title_suffix }} and trying to fix the contextual links in the .theme and also adding theme on block alter hook, none of those seems to work,

Steps to reproduce

1. Create a Layout Builder situation
2. Create custom blocks using paragraphs
3. Create a custom theme with custom templates for those blocks
4. Place them on your layout
5. Go to Layout and watch as they don't have contextual links attached

💬 Support request
Status

Closed: works as designed

Version

10.2 ✨

Component
Layout builder  →

Last updated about 24 hours ago

Created by

🇪🇸Spain mpereztejeiro

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

Comments & Activities

  • Issue created by @mpereztejeiro
  • 🇮🇳India deborahblessy

    Hi @mpereztejeiro ,

    Instead of theme, you can try to add on relevant twig file template to achieve this.

    Could you explain about the solution to achieve ? I can help you on that.

  • 🇪🇸Spain mpereztejeiro

    Hi @deborahblessy,

    Thanks for your reply,

    Basically I only need to be able to see those contextual links in order to edit the block configuration/content in those blocks,

    The idea of the theme comes from client side so that was my only option and since we need to add personal CSS code we went with a custom theme,

    KR,

  • 🇺🇸United States cilefen

    The steps to reproduce require a custom theme which we do not see. For this to be a bug report we would need it demonstrated that this is a bug.

  • 🇪🇸Spain mpereztejeiro

    Hi,

    I solved the issue... It seems that {{ title_prefix }} and {{ title_suffix }} on there own without a div with the right class didn't do the trick,

    However I added:

    
    {%
      set classes = [
        'block',
        'block-' ~ configuration.provider|clean_class,
        'block-' ~ plugin_id|clean_class,
      ]
    %}
    <div{{ attributes.addClass(classes) }}>
      {{ title_prefix }}
      {% if label %}
        <h2{{ title_attributes }}>{{ label }}</h2>
      {% endif %}
      {{ title_suffix }}
    </div>
    

    And did the block content appart as I need it to be and everything was working again,

    It seems that the configration.provider was the part that i was missing on the div in order for the configuration to work,

    Thanks for the help,

    KR,

  • Status changed to Closed: works as designed 9 months ago
  • 🇺🇸United States cilefen
Production build 0.69.0 2024