When i used the bootstrap layout i cannot find the wrapper attributes for the layout.

i have worked in this patch to added it.

now you can add outer wrapper (class and id ) for display suite and panel pages.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Ahmad Abbad created an issue. See original summary.

Ahmad Abbad’s picture

ruhaim’s picture

Hi Ahmed,
I tried your patch, seems ok.
But I suggest using the default display suite class instead of writing your own

We could replace the
class: '\Drupal\bootstrap_layouts\Plugin\Layout\BootstrapLayouts'
with
class: '\Drupal\ds\Plugin\DsLayout'

Any special reason / advantage of having your own?

Thanks,
Ruhaim

Ahmad Abbad’s picture

Hi Ruhaim,
That's what I was thinking about, but when we replace it to '\Drupal\ds\Plugin\DsLayout' that will make Bootstrap Layouts module dependence on Display suite module.

darol100’s picture

@Ahmad Abbad, I believe this issue was fixed by #2788997: Contextual links not showing. We added { attributes.addClass('row') }} so other modules can add attributes. Can you check if you can add the attributes now ?

markhalliwell’s picture

Assigned: Unassigned » markhalliwell
Status: Needs review » Needs work

It was not.

@Ahmad Abbad is correct that there needs to be a bootstrap_layouts specific class to handle this. And to confirm the question in #3, @Ahmad Abbad is also correct that it should be namespaced to this module, not ds, which would break any panels implementations (if they don't have DS installed).

I'll work on getting this up to par.

markhalliwell’s picture

Title: Support wrapper attributes (class and id) for layouts » Implement custom Layout plugin class to handle settings
Related issues: +#2831139: Layout plugin configuration doesn't show up

Renaming title to better reflect what is happening which will also touch several other issues in this IQ, which I'll likely mark as dups of this one once I have a working patch here.

Also, I ran into this semi-related bug in DS.

markhalliwell’s picture

Title: Implement custom Layout plugin class to handle settings » Refactor module to be plugin based and allow template settings

This is essentially going to be a refactor.

I'm almost done and hope to have a patch up shortly, which will also include an update hook to update existing layout instances. Unfortunately any themes that implemented their own custom templates will need to be manually updated.

That being said, I think it would make more sense to create a 8.x-4.x branch. I don't think we'll need to worry about keeping BS major version parity here.

If/when BS4 has different markup/classes... we can discuss how to handle that (likely some sort of setting that can be toggled).

markhalliwell’s picture

Assigned: markhalliwell » Unassigned
Category: Feature request » Task
Status: Needs work » Needs review
FileSize
112.61 KB
229.86 KB

Alright, here's the massive patch that completely refactors the module to take advantage of plugins.

Overview:

  1. All layouts layouts have been redesigned and there are now only 4 types of column based layouts (in the sense of the layout, not "bootstrap columns", each with their own "bricked" and "stacked" variations):
    • bs_1col
    • bs_1col_stacked
    • bs_2col
    • bs_2col_bricked
    • bs_2col_stacked:
    • bs_3col
    • bs_3col_bricked
    • bs_3col_stacked
    • bs_4col
    • bs_4col_bricked
    • bs_4col_stacked
  2. These templates are now in a 3.0.0 version based folder. I did this as a way to, in the future, create version based templates if needed. This allows this to be committed to a new 8.x-4.x branch and thus allowing us to break the framework major version parity.
  3. The UI has been completely redesigned to work with any implementation (e.g. DS and Panels) with many similarities borrowed from DS to allow configuration for the layout itself plus each region (note: I just increased the size of the classes box in the screenshot to show you can choose multiple, it doesn't actually look like that):
  4. There is an update 8401 that can be run to convert any existing templates. There's an elaborate update hook/plugin system available to easy allow processing of existing templates (for future changes). Currently, due to the fact that "Panels" is just an API in D8, the only handlers supported in this update are Display Suite and Page Manger. I thought about Panelizer, but it didn't seem to have that much usage. That can be a follow-up issue/update.
  5. I'd like to become a co-maintainer if possible. I went ahead and added myself to the README as I don't see this being a problem as I will be making this a "supported" module for the base theme (follow-up issue to come).
markhalliwell’s picture

Oh, I also meant to mention that I plan on (eventually) looking into developing a more interactive UI (e.g. sliders, checkboxes, breakpoint management, etc.) like Omega has done to replace all this multitude of classes. However, for now, this is a great start as it (at the very least) allows for a very dynamic base layout.

markhalliwell’s picture

markhalliwell’s picture

+++ b/src/Plugin/BootstrapLayouts/Updates/BootstrapLayoutsUpdate8401.php
@@ -0,0 +1,61 @@
+    foreach ($layout_map['regions'] as $old_region => $region) {
+      if ($region_data = $layout->getRegion($old_region)) {

This needs to check if $old_region !== $region so it doesn't delete the region during the update.

Follow-up issue once this gets committed.

Ahmad Abbad’s picture

Hi markcarver,

Thank you for the great patch.

I have test it and it's worked good.

markhalliwell’s picture

Version: 8.x-3.x-dev » 8.x-4.x-dev

  • markcarver committed f03dfe1 on 8.x-4.x
    Issue #2784265 by markcarver, Ahmad Abbad: Refactor module to be plugin...
markhalliwell’s picture

Status: Needs review » Fixed
markhalliwell’s picture

Re: #12, I went ahead and made the necessary changes during the commit.

markhalliwell’s picture

Okie dokie. This is more or less done :D

Status: Fixed » Closed (fixed)

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