Problem/Motivation

Having number of breakpoints when we add Bootstrap Col 2 and more

Steps to reproduce

Given that the "Bootstrap Layout Builder" was enabled and configured on a site
And a list of "Breakpoints" and "Layout options"
And configured to be used with a selected content type
When we add a new section
And the number of columns was "2 or more"
And each breakpoint has a list of layout options
And we did not select any layout option
Then no default value will set for 2 columns

Proposed resolution

  • Have a default layout option when we add a new sections on listed breakpoints to use the first key value for each breakpoint. Needed for 2 columns and more

Remaining tasks

  • Patch
  • Test

User interface changes

When we add a new section with 2 or more cloumns

API changes

  • None

Data model changes

  • None
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

RajabNatshah created an issue. See original summary.

rajab natshah’s picture

Issue summary: View changes
rajab natshah’s picture

Issue summary: View changes
rajab natshah’s picture

StatusFileSize
new798 bytes
rajab natshah’s picture

Status: Active » Needs review
rajab natshah’s picture

Assigned: rajab natshah » Unassigned
jollysolutions’s picture

Status: Needs review » Reviewed & tested by the community

Works fine for me.

mahmoud-zayed’s picture

Status: Reviewed & tested by the community » Needs work

Hi Rajab,

Thanks for this feature, I think we can make the default option configurable from the admin panel so we can choose which option suitable for a specific device.

rajab natshah’s picture

StatusFileSize
new178.82 KB

Thank you, Mahmoud for following up on this issue

Happy to know that you liked the idea

It is in my next 2 weeks sprint to work on number of improvements.

Add Default config values for Bootstrap Styles and Bootstrap Layout Builder

Product Varbase backlog

Investing time on this as a patch for sure. it could be in 2 patches for BLB and Bootstrap Styles

Testing 2 options:

  1. Having a new page for default values ( Suggested to have - not to make the form too much to work with, and it could have it's own default yml config file )
  2. Having a new field next to each Layout Config or Styling Config. ( Razem recommended this option )

Option #2 could be better with a smart tip field to hid/show the default config value.
Researching the best config saving option, and which HTML widget to use

cassioalmeida’s picture

Status: Needs work » Needs review
StatusFileSize
new70.54 KB
new68.54 KB
new89.23 KB
new9.03 KB

Hi everyone,

I'm submitting a patch in order to add this feature.

This adds a is_default option in the layout's options's list.
As it saves the is_default flag for all selected breakpoints in the option, and remove from any previous option with the same breakpoints.

Options List

Options Edit

Default Selected

mahmoud-zayed’s picture

Status: Needs review » Needs work
StatusFileSize
new84.4 KB
new83.44 KB

Thanks, Rajab and Cassio!

@Cassio I have the following recommendations:

  • We need to add the ability to select more than one device as the default option.
  • It should be relative to the selected enabled breakpoints for the current layout option, so show&hide the options we can select as default.
  • In List layout options table, we can see at the default column each breakpoint show up maxmum once.

Please check the following screenshots for clarification:
Default
Listing

The description text in the screenshot:
"Select the breakpoints if you want to make this layout option the default option for them.
Note: if the breakpoint already selected as the default option for another layout option, this selection will override it."

Thanks :)

cassioalmeida’s picture

Thanks for the feedback @Mahmoud.

I'll work on that change today.

cassioalmeida’s picture

Assigned: Unassigned » cassioalmeida
Status: Needs work » Needs review
StatusFileSize
new78.55 KB

@Mahmoud, I updated the Merge Request with the new code. Could you please review and let me know if this is good?

Multiple Default Options

Thanks!

  • mahmoud-zayed committed 80a855a on 2.x
    Issue #3201441: Remove unused statement s& run code sniffer.
    
mahmoud-zayed’s picture

Assigned: cassioalmeida » Unassigned
Status: Needs review » Fixed
rajab natshah’s picture

Thank you so much Mahmoud and Cassio for having the default breakpoints
Saved us big time on this

I'm only hopping for more

To follow in new issues

Edited: with more updates

Status: Fixed » Closed (fixed)

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