Currently, in the Drupal 8 port, you can choose the layout when creating a new variant, but can't change the layout after the fact.
In the end, we should provide a UI similar to Drupal 7 which allows you to choose a new layout and then map the regions from the old layout to the new.
However, that will be much easier after we finish #2550879: Use CTools Wizard API to add/edit Pages (and move plugin UI using PluginWizardInterface).
For the time being we just need any UI that will work! This could move all the blocks that are on regions that no longer exist to the first region (or last region?), and leave blocks alone that are on region names that also exist in the new layout. This is not ideal, but it would at minimum allow changing layouts...
Comment | File | Size | Author |
---|---|---|---|
#10 | interdiff.txt | 1.85 KB | dsnopek |
#10 | panels-simple-layout-ui-2558575-10.patch | 6.95 KB | dsnopek |
|
Comments
Comment #2
swentel CreditAttribution: swentel commentedThis is closely related to #2550879: Use CTools Wizard API to add/edit Pages (and move plugin UI using PluginWizardInterface) no ?
Comment #3
dsnopekYeah, if that issue lands than this will be implemented as a "Layout" wizard step. If that issue doesn't land... I'm not sure how we'd implement, but it'll be harder than if it does land. :-)
Comment #4
dsnopekNow that #2550879: Use CTools Wizard API to add/edit Pages (and move plugin UI using PluginWizardInterface) is postponed to "Milestone 2", I'm going to re-scope this issue to just building any UI that can work, rather than trying to replicate the D7 UI or making the "ideal UI".
Comment #5
phenaproximaHere's as far as I got with this patch. This adds the widget (UI element), but does not have any backend logic to actually save the blocks' configuration. Because, as @dsnopek and I discussed on IRC, it would conflict with Page Manager.
Comment #6
dsnopek@phenaproxima's UI and the 'map' element are super cool!
However, I spent a bunch of time trying to get this to work and couldn't due to the fact that page_manager is providing the block placement UI, and updating the block configuration AFTER our
submitConfigurationForm()
is run. I tried adding an additional #submit callback, and just couldn't come up with anything that would work.The only thing I could come up with was updating the block placement in
setConfiguration()
, however, this is already after the form has been submitted and it would be crazy hacky to pass in the mapping information here (since it isn't actually valid configuration).So, I simplified the patch greatly, and made the
setConfiguration()
look for blocks placed in invalid regions and set them to the first valid region. Even though this is a hack, it can be justified as simply making invalid configuration valid, so it's a little less icky.Comment #8
dsnopekThis should fix the strict PHP warning that the testbot is complaining about!
Comment #9
samuel.mortensonFound a small bug:
Settings are set correctly if you were previously using a Display Suite layout then decide to switch to another Display Suite layout, probably because the original form was built with the correct elements.
Comment #10
dsnopekAmazing catch, Sam, thanks!
Here's a patch that fixes this issue in my testing. Please let me know if it works for you!
Comment #11
samuel.mortensonThat fixes my original problem, nice job!
Comment #12
japerrySeems like the only issues I could find are related to page manager itself. It seems like the patch in #10 does allow for basic layout switching.
Comment #14
japerrywoot, fixed.