Block title always shown in render from Content Hub 2.x

Created on 15 September 2020, over 4 years ago
Updated 27 February 2023, almost 2 years ago

Problem/Motivation

When Content Hub exports a rendered block, it should respect the "Show title" configuration for the block. Currently it seems that the block title is always rendered in the exported markup.

Steps to reproduce

Create a custom block. Disable the "Show title" option. Publish this block to content hub 2.x. Then use Lift to inject this block into a page. You will see the block title.

Workaround

On our specific site, we never render the block titles. The default twig has this:

<div{{ attributes }}>
  {{ title_prefix }}
    {% if label %}
      <h2{{ title_attributes }}>{{ label }}</h2>
    {% endif %}
  {{ title_suffix }}
  {% block content %}
  ...

and we can remove the title from the rendered content hub version using a template of:

<div{{ attributes }}>
  {{ title_prefix }}{{ title_suffix }}
  {% block content %}
  ...

NOTE that the title_prefix and title_suffix are still required for Layout Builder to add the contextual links. So somehow the "label" field is getting set when the block is programmatically rendered for content hub.

Sites using the previous Content Hub v1.x don't seem to have this problem.

πŸ› Bug report
Status

Closed: won't fix

Version

2.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States mpotter

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024