Problem/Motivation

When using a fair number of text fields, the demo text that appears in the content type level layout builder seems a bit much.

Steps to reproduce

While using layout builder
Add some text fields on a content type
Go to the content type level layout builder
See all the demo text for each field, depending on the number of fields could be a lot of scrolling

Proposed resolution

Reduce default text shown

Remaining tasks

Implement

User interface changes

Yes less text

Introduced terminology

NA

API changes

NA

Data model changes

NA

Release notes snippet

NA

Original post

There needs to be something in between toggling "Show content preview" and the amount of characters displayed by lorem ipsum/devel when working with multiple fields.

It's nice to have the content preview so you can confirm that any labels are completed but not have it followed by paragraphs of text

Issue fork drupal-3093283

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

laura.gates created an issue. See original summary.

Version: 8.7.x-dev » 8.8.x-dev

Drupal 8.7.9 was released on November 6 and is the final full bugfix release for the Drupal 8.7.x series. Drupal 8.7.x will not receive any further development aside from security fixes. Sites should prepare to update to 8.8.0 on December 4, 2019. (Drupal 8.8.0-beta1 is available for testing.)

Bug reports should be targeted against the 8.8.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.9.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.7 was released on June 3, 2020 and is the final full bugfix release for the Drupal 8.8.x series. Drupal 8.8.x will not receive any further development aside from security fixes. Sites should prepare to update to Drupal 8.9.0 or Drupal 9.0.0 for ongoing support.

Bug reports should be targeted against the 8.9.x-dev branch from now on, and new development or disruptive changes should be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.9.x-dev » 9.2.x-dev

Drupal 8 is end-of-life as of November 17, 2021. There will not be further changes made to Drupal 8. Bugfixes are now made to the 9.3.x and higher branches only. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.2.x-dev » 9.3.x-dev

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.15 was released on June 1st, 2022 and is the final full bugfix release for the Drupal 9.3.x series. Drupal 9.3.x will not receive any further development aside from security fixes. Drupal 9 bug reports should be targeted for the 9.4.x-dev branch from now on, and new development or disruptive changes should be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.9 was released on December 7, 2022 and is the final full bugfix release for the Drupal 9.4.x series. Drupal 9.4.x will not receive any further development aside from security fixes. Drupal 9 bug reports should be targeted for the 9.5.x-dev branch from now on, and new development or disruptive changes should be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

earthangelconsulting’s picture

I understand that Drupal is continuing to evolve but... has this issue actually not made it into a priority list anywhere? The first time I tried Layout Builder in Drupal 9, this problem seemed really obvious to me too!

Version: 9.5.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

nicxvan’s picture

Version: 11.x-dev » 11.1.x-dev
Component: extension system » layout_builder.module
Issue tags: -Layout Builder

I think this actually belongs in the devel module.

This definitely isn't an extension system.

Moving it to layout builder for now because the devel module doesn't support issues.

quietone’s picture

Version: 11.1.x-dev » 11.x-dev
Status: Active » Postponed (maintainer needs more info)

This does look like an issue for Devel. An issue for Devel, then an issue can be made at https://gitlab.com/drupalspoons/devel/-/issues/new.

There has been only 1 comment supporting this feature, so this could be closed for lack of interest.

I am setting the status at Postponed (maintainer needs more info) to determine if there is interest in adding this to the layout builder module. If we don't receive additional information to help with the issue, it may be closed after three months.

danielveza’s picture

I don't believe this is a Layout Builder issue, it's just that Layout builder is exposing this.

If I understand it correctly, the issue thats raised here is that too much sample text is being generated by textarea fields when placed in Layout Builders default layout. We can trace this down to either StringLongItem::generateSampleValue or TextItemBase::generateSampleValue (based on field type) that both call Random::paragraphs() without a parameter, which means it will generate 12 paragraphs of sample text.

As quietone mentioned, there isn't a lot of activity here to explore making this change at the moment, but just leaving this here as a reference point in case people are interested in exploring this change.

smustgrave’s picture

Title: Allow Lorem Ipsum/Devel to be configurable in Layout Builder » Reduce default text in layout builder
Priority: Normal » Minor
Issue summary: View changes
Status: Postponed (maintainer needs more info) » Active

I actually think this is actually worth doing. If you have even 3 text fields all that default text can be a lot of scrolling.

Version: 11.x-dev » main

Drupal core is now using the main branch as the primary development branch. New developments and disruptive changes should now be targeted to the main branch.

Read more in the announcement.

danielveza changed the visibility of the branch 3093283-reduce-default-text to hidden.

danielveza’s picture

Status: Active » Needs review

I still don't think this is a Layout Builder issue, but either way I've pushed up a change that will reduce the amount of paragraghs that Text & String Long fields will generate from 12 to 2.

smustgrave’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: +Needs Review Queue Initiative
StatusFileSize
new231.29 KB

works!

Worked like a charm!

  • godotislate committed 8f8e3ac8 on main
    chore: #3093283 Reduce default text in layout builder
    
    By: danielveza
    By...

  • godotislate committed 9e4a9af8 on 11.x
    chore: #3093283 Reduce default text in layout builder
    
    By: danielveza
    By...
godotislate’s picture

Component: layout_builder.module » text.module
Status: Reviewed & tested by the community » Fixed

Committed 8f8e3ac and pushed to main and committed 9e4a9af and pushed to 11.x.

I was wondering if there's any one out there relying on long text in the preview to check whether their layouts look right, maybe if they're using floats or something. But my guess more people would just create test content to do that instead. Either way, reason enough not backport to 11.3

Thanks everyone!

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

godotislate’s picture

Version: main » 11.x-dev

Status: Fixed » Closed (fixed)

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