Problem/Motivation
During usability studies, we observed a conceptual problem caused the names of the menu regions. Some users thought that the 'primary menu' region was the primary menu block. They tried clicking on it to drag it around.
Also, naming a region after the content within the region is not best practice for themes. You can add any content to the primary menu region, and then this name becomes even more confusing.
Proposed resolution
Figure out better names for the regions that describe their position/role on the page, rather than the content inside of them. Then change core default settings as well as the Bartik and Classy themes to implement the new names.
Remaining tasks
Discuss a better name for the menu regions
Patch
User interface changes
Different labels on the block layout page
Final choice is:
header_first: 'Header first'
header_second: 'Header second'
header_third: 'Header third'
API changes
Any sites using these regions will break
Data model changes
Yes, all placed blocks need to be checked.
Beta phase evaluation
| Issue category | Task because it is refactoring CSS and templates in Bartik |
|---|---|
| Issue priority | Not critical because Bartik functions fine we are just doing cleanup tasks |
| Unfrozen changes | Unfrozen because it only changes CSS and markup |
| Prioritized changes | The main goal of this issue is usability of the Bartik's codebase |
| Disruption | Disruptive as it will impact custom themes on site update |
| Comment | File | Size | Author |
|---|---|---|---|
| #182 | 2513526-menu-regions-182.patch | 43.4 KB | dcrocks |
| #182 | interdiff-2513526-177-182.txt | 6.03 KB | dcrocks |
| #177 | interdiff-2513526-161-177.txt | 6.55 KB | dcrocks |
| #177 | 2513526-menu-regions-177.patch | 39.18 KB | dcrocks |
| #175 | rename_the_menu_regions-2513526-175-reroll.patch | 37.97 KB | joelpittet |
Comments
Comment #1
lewisnymanComment #2
lauriiiComment #3
dcrocks commentedI took a shot at this. I followed previous patterns here by renaming the regions to header_first, _second, and _third, though my prefernce would have been to rename them to header_top, _main, _bottom. But judging from previous discussions, that might not be neutral enough.
Comment #5
dcrocks commentedThe failing tests assume the region 'header' is defined. As far as I know, the tests use Stark which has no region definitions, but pick up the default region definitions from ThemeHandler.php. There are several possible solutions:
Change Themehandler to continue to specify 'header' as a default region. But this means bartik will have a region of 'header' as well as 'header_second', since it inherits from ThemeHandler.php.
Change all the tests to specify 'header-second', but this makes the tests bartik centric.
Leave region 'header' as is, but change the menu regions to 'header_top' and 'header_bottom'.
Use 'header_main' instead of 'header_second' and change all the tests.
A question I have is why does the system page.html twig even have the menu blocks specified and ThemeHandler's default regions have the menu regions, when this really a theme specific thing? Shouldn't core themes specify their own required regions for the blocks they expect to display? It seems some assumptions about core themes are built into the System files and ThemeHandler.php without any backward documentation in core themes.
I know these are "system" menus, but they are theme objects and should be only defined there. My 2 cents, and will fix as recommended or pick my own favorite if no quick response.
Comment #6
dcrocks commentedI decided to leave 'header' as is and renamed the regions to header_top, _bottom. I think some of the conceptual problems mentioned have more to do with the block ui than region names. I never understand why drupal didn't have a region structure ui instead of a block ui. Regions are the container, after all.
Comment #7
lewisnymanRelated: #2005546: Use branding block in place of page template branding variables (site name, slogan, site logo)
I think I prefer first/second/third. Only because top/middle/bottom implies a stacked design, which we shouldn't do.
Comment #8
dcrocks commentedOk, I'll redo it but still leave 'header' defined in ThemeHandler.php as it seems to want to mimic the semantic elements, but not in Bartik. That also means the block tests won't have to be modified. 'Header_second' might be a good target region for #2005546: Use branding block in place of page template branding variables (site name, slogan, site logo).
Comment #9
dcrocks commentedSince there many, many references to region 'header' in #2005546: Use branding block in place of page template branding variables (site name, slogan, site logo) I redid this with regions header, header_first, and header_second. There are patch conflicts with latest #2005546: Use branding block in place of page template branding variables (site name, slogan, site logo) so which ever one goes in 2nd will need a reroll.
Comment #10
dcrocks commentedDoh
Comment #11
MattA commentedPersonally I think that using "Header" and "Header first" will be ambiguous for users since they won't know which is meant to be the primary region from select boxes. Perhaps rename to "header", "navigation top", "navigation bottom"?
Comment #12
dcrocks commentedAs per the issue summary, the region names chosen seemed to cause confusion as people seemed to think they could move the region around when all you can do is move blocks. This is a problem with the block ui, which has many issues against it. And there has been a trend in drupal core themes to make region names semantically relevant but don't provide functional or layout definition.
In drupal the primary and secondary menus are special menus with a special 'use' case that a great many people are aware of and look for. They are a carry over from previous drupal versions and the names serve as a mnemonic for those who look for them and the justification of the original region name. That is why I didn't change any of the file names, just the internal labels. We still have primary-/secondary-/menu.css. Maybe one day, support for that use case will go away or be generalized.
Maybe header_sidebar1, -2 would be more acceptable and in keeping with core theme design.
Comment #13
MattA commentedHmm, thought about it a bit more, and really don't think header first/second is the best option for a couple reasons.
Comment #14
bill richardson commentedYou could just move both menus into header and use css to place them correctly.
Comment #15
dcrocks commentedI don't think the right issue is defined here. As far as the conceptual issues with the block ui I don't think changing the design of a specific theme really addresses that problem. If instead, bartik's current design doesn't reflect best practices, then that is something else.
Comment #16
davidhernandezThis does seem confusing. Ordinal naming is fine, but it doesn't make sense when keeping one region just called "header", with first before it and second after it.
Comment #17
joelpittetI'd so like to keep this as "primary_menu" and "secondary_menu" region keys. Can we just suffix the regions with " Region" to avoid confusion? Or just rename the labels slightly?
-1 to header_first/header_second and renaming the regions in code at this time
Can we look for a cosmetic fix here?
Comment #18
dcrocks commentedAdding a suffix of _region seems redundant in the context in which they are displayed. We could adopt pre_header and post_header or we could adopt a triplet of header_first/_content/_last, or header_top/_content/_bottom. None of these indicates what is in those regions while hinting their layout. It will just make the patch slightly larger. And I'm slightly against having region names the same as the semantic unit they belong to(region 'header' inside
<header>).One of the issues is because the block ui lists regions in the order they are defined in info.yml, not in their order in the theme layout. How would users react if they saw the block ui page in the attached image? We could recommend that regions be defined in info.yml in the order they appear in the theme layout but none of the current core themes follow that practice.
I also think the conceptual issue reported in the issue summary wasn't specific to primary and secondary menu. They just happened to be first on the page. The names may violate best practice, but it would be nice to keep them.
Comment #19
dcrocks commentedJust a nit. I've always disliked the block ui because the table displayed is really indexed by region though the label above the first column says BLOCK and the column labeled REGION contains a selector for the assigned region. I understand the table but found the column labeling confusing the 1st time I saw it. You could change the BLOCK label to REGION >> BLOCK.
Comment #20
prajaankit commentedComment #21
dcrocks commentedIs this a re-roll or did you make changes?
Comment #22
dcrocks commentedThis is a minimalist change. Internally the region name remains primary and secondary menu but the label displayed is 'Pre header' and 'Post header'. It amounts to a 2 line change.
Comment #23
dcrocks commentedOpps. If this is accepted I'll have to change the default region list also. 4 lines.
Comment #26
dcrocks commentedA decision should be made soon, it doesn't really help to drag this out. My understanding of status as of now:
We should leave 'header' region as is. A change here would have impact on other issues currently in process and require changes to at least 4 tests. Not sure it is worth it.
3 possible solutions:
1) Do nothing and rely on changes elsewhere to improve concerns raised in summary.
2) Rename primary_menu and secondary_menu regions thru out bartik code. API impact because of sites currently using these region names.
3) Leave the machine names for primary and secondary menus the same but change the human readable name to something that reflects best practices. This is really just a cosmetic change and won't entail api change.
So far suggested names for the 2 regions include:
header_first/top/start/begin
header_second/bottom/end/last
navigation_top/bottom
begin/start/top/pre/ante_header
end/finish/bottom/post_header
Comment #27
davidhernandezHonestly, I think emma.maria should be the one making the call on region names and I don't see any comments from her yet. I'm tagging for maintainer review.
Comment #28
joelpittet#22 is the direction I am hoping for, thanks for considering it @dcrocks. The names may not be right but it doesn't cause too much fuss around renaming all the things and less disruptive of a patch in general if it will be enough?
To me "Navigation" is a nice catch all for menus, pagers, etc and may help.
So throwing in "Primary Navigation" and "Secondary Navigation" into the mix to help distinguish the Menu block from the Region.
I'd leave the call to @emma.maria though.
Comment #29
lewisnymanit's worth it. We shouldn't ship D8 with these region names and we still are within scope of changing them in beta. Bartik is supposed to be an example of best practices. This is the same as renaming 'main menu' to 'header menu'.
This doesn't solve the problem, it's confusing because regions can contain any content, not just menus and pagers. Calling them 'Primary Navigation' is describing the content, not the region.
Comment #30
dcrocks commented@LewisNyman 'header' - It is doable but is an api change for current themes. I had considered header_content or header_main. Do you have a suggestion?
Comment #31
joelpittet@LewisNyman good points... can we do without a new region then for these blocks? AKA remove them?
Comment #32
dcrocks commentedThe only other region currently available to place blocks is 'header'. And bartik's current page.html.twig is hardcoded to add system logo, slogan, and site name. The menus are supposed to sandwich that code so it would be very difficult to lay that out properly by placing them in a region that is rendered after that code. That will change after #2005546: Use branding block in place of page template branding variables (site name, slogan, site logo) but I think that issue's 'branding' block will be placed in 'header' as its region.
Comment #33
dcrocks commentedBecause I had time. This is strictly cosmetic for bartik only. But for the long term, all 3 regions should be renamed.
Comment #34
lewisnyman@joelpittet I think we have a requirement to maintain those regions, because we need some way of replacing the 'main-menu' with any other menu and maintaining the same styling. The region was chosen as a way of applying a common class to any menu to trigger the styling. I can't think of a better way of doing this in D8.
Comment #35
joelpittet:( can't win one way can't win the other...
Comment #36
manjit.singhmenu regions are renamed now. check screenshots.
Comment #37
dcrocks commentedRenamed where?
Comment #38
dcrocks commentedI tried to see if this could be done with css alone and it doesn't look simple. The styling for these menus is tied to them being in these regions. Put them in another region and they only have default menu styling. Put other menus in these regions and they will acquire styling written for the primary and secondary menus. I tried both cases and they result in unsatisfactory output.
I may be wrong but I thought the styling on blocks is supposed to be region agnostic. It isn't on these 2 blocks. Since it is apparent in bartik that these 2 regions are targeted to have these 2 menus, and these 2 only, why is it wrong to have the region name indicate the content it is targeted for?
Lastly, I thought the purpose of regions was to create layout and to optionally provide common styling attributes for their content. In bartik they are treated as components, which seems odd to me.
And why is a class name(site-footer) treated as a component?
Comment #39
dcrocks commentedComment #40
dcrocks commentedComment #41
lewisnyman@dcrocks @joelpittet We should keep the machine names inline with the visible names. That's going to be really confusing for developers otherwise.
I think we can add a class by overriding the region.twig.html file in Bartik. Something like:
Comment #42
emma.mariaI think the regions should be called.
This follows the same patterns used for other regions. The region names should not hint at what content they have, as they in theory could contain anything. The only thing the names need to convey is that they are all found within the header section of the markup with a number hierarchy to distinguish them from each other.
Also each region needs to be assigned with first, second etc, we can't have one that is just called 'header' on it's own.
The names in #33 are not immediately logical to the user and break the patterns of other grouped regions in Bartik.
Please can we have a patch with Header first, header second, header third.
If tests break because we are renaming regions we will have to fix them. We should not implement a half fix or just a cosmetic fix as we are trying to fix usability here.
Comment #43
dcrocks commentedI'll start work on this but I want to point out the 'featured-top' and 'featured-bottom' also break the pattern. If that pattern is allowed might we consider the top/main/bottom pattern for header?
ps. and we also have page top/bottom
Comment #44
manjit.singhAdded Header regions as per feedback by Emma in #42, See if it breaking structure or not ;)
Comment #46
dcrocks commentedThis patch is probably incomplete. It:
Does region name rename only
It ignores changes to these same files currently being worked on in other issues.
It doesn't change maintenance page files or css
Doc changes should include modules/help/help.php.api
Comment #48
dcrocks commentedAnother try. I had forgotten Classy. The problems are in some of the block tests but not sure yet what the problem is.
Comment #50
dcrocks commentedKnow what it is, fix tomorrow.
Comment #51
emma.maria@dcrocks:
Featured top and bottom do not sit next to each and are supplementary regions to the Main content. Featured bottom also consists of three regions so the Top | Bottom naming convention was needed.
Bartik has one header that consists of three regions that come after each other, so the first | second | third naming convention works well here.
Also @dcrock's can you merge your patch with @Manjit.Singh's patch in #36 and carry on with the work. You did not review his patch before posting your own and his work had a correct start to the solution, the same code in your patch has whitespace at the start of the lines.
Thanks.
Comment #52
dcrocks commented#36 doesn't have a patch. @manjit.Singh's last patch was in #44, and only changes bartik.info.yml, which has been done in all my patches. And all the region definitions in bartik.info.yml have whitespace at the start of the line.
I am hoping this patch will fly.
Comment #53
dcrocks commentedbump
Comment #54
tim.plunkettWe'll have to fix all the placed blocks.
Comment #55
dcrocks commentedI was worried about migration issues. Where is that done? I am also still worried about the system maintenance page.
Comment #56
emma.maria#52: OK sure. I noticed the following from your patch in dreditor and I got mixed up.
Comment #57
dcrocks commented@emma.maria I'm not sure why the patch looks like that but if you look at the generated code everything is fine. Maybe has to do with git and tabs?
Comment #58
lewisnyman@dcrocks That happens when you have whitespace in the file. You can set up your text editor to trim the whitespace and use spaces instead of tabs: https://www.drupal.org/node/1346890
Comment #59
dcrocks commentedWhat's there works, but needs review.
Comment #60
lewisnyman@dcrocks What do you want tested? There are formatting issues in the patch that need to be fixed.
Comment #61
lauriiiWorking on the upgrade path
Comment #62
dcrocks commentedThe patch needs to be tested for visual regressions and the code reviewed, even though it is mostly substitutions..
Comment #63
lauriiiMaybe it would be good idea to add the changed region names to the IS
Comment #64
lauriiiComment #65
dcrocks commentedIs update
Comment #66
lauriiiWe also need to update the issue to contain other themes and core because they seem to have the same regions too.
Comment #67
lauriiiPosting my progress. Broken upgrade path which cannot handle themes which this shouldn't affect etc. We also need tests for that.
Comment #68
lewisnymanAlso we noticed that the order of the regions in the page template does not match the names of the regions. I don't see a reason to choose his order.
Comment #69
lauriiiUps empty patch
Comment #70
lauriii@lewisnyman: I fixed that already in my patch
Comment #71
dcrocks commentedIS update.
Comment #72
lauriiiNothing to review
Comment #73
longwaveComments don't match the region names.
What do we need to do about the upgrade path? For Bartik it should be (reasonably) straightforward, but what about a custom theme that extends Classy? If they have overridden page.html.twig don't they need to update their template to match?
Comment #74
tim.plunkettWe have to load all blocks using the old region names and resale them with new ones.
Comment #75
longwaveThat is what the update hook does in the latest patch, but this does this blindly for all themes. We can limit this to Bartik or Classy by adding an extra property condition, but we also need to consider subthemes of Classy, but only if they relied on the default regions and didn't provide their own custom "header" region in the theme info file. And if they used the defaults, we will still break their theme if they have a custom page.tpl.php that refers to the old region names.
Comment #76
dcrocks commentedRead the IS. That is exactly what is expected if this issue is committed.
Comment #77
lewisnymanCan we get a clarification that we can change templates still? The beta rules say we can, but the upgrade path says we can't?
It would be really sad if we are stuck with these region names for the whole of Drupal 8.
Comment #78
davidhernandez@Lewis, we can change templates and regions. The problem is we now need upgrade hooks to move anything that was in the region we removed/renamed to put those blocks into the new regions, so the blocks aren't orphaned. If we don't, when someone updates their site they'll get those "block set to region that doesn't exist..." errors, or whatever it says.
Comment #79
lewisnymanSo if someone has overridden the default page.html.twig - it's ok that it will break now? We can just provide a change record?
Comment #80
longwaveIn this patch I fixed the comments, moved the update hook to block.install, and started writing a test. But the test fails, I think because block_rebuild() fires before the update hook is run, so the blocks are already disabled by the time we try to move them.
Comment #81
longwaveComment #83
dcrocks commentedYou missed the comments in modules/system/templates/page.html.twig. I mapped the regions to reflect the order in which they appeared in bartik's output, you used their original order in comments. 6 of one, half dozen the other.
Comment #84
dcrocks commentedThe update places the blocks as
.
But the test assumes 'secondary_menu' is in 'header_first'. Need to decide what placement order is desired as inconsistent now. Perhaps follow the order define in ThemeHandler.php?
Comment #85
davidhernandezRE #79 yes, templates are not frozen so we can make changes to them. We should have change records for changes to page template because of the significance of the template, and adding or removing variables/regions from the default template is pretty significant.
What we need an update hook for is the blocks. Changing the block regions is like a schema change, since the values are stored in the database. It won't affect a theme that defines its own regions (nor would the page template changes) but a theme using the defaults will have a problem.
Adding change record tag. We need one for the region changes.
Comment #86
dcrocks commentedI made the small changes I indicated in #83 and #84.
Comment #88
emma.maria@dcrocks from your comment #84 I just need to check the following is being set.
With the ordering of Bartik's current regions, the region changes should be:
Secondary menu -> Header first
Header -> Header second
Primary menu -> Header third.
Comment #89
lauriii@dcrocks: could you please post an interdiff while you change something to make it easier to follow what has been changed between patches. Yoi can find the documentation about how its done here.
Comment #90
dcrocks commented@emma.marie That has been the pattern I've been following but the patch in #80 suggested a possible different choice. Thanx for the direction.
@laurii Sorry, I'm not adept with Git, but I'll try to follow best practices from here on.
Comment #91
rainbowarray@dcrocks: Here are some instructions on making an interdiff. Fairly similar to making a patch. You just need to branch off 8.0.x to commit the last patch, and then you can diff between the branch you are working on and that up-to-date last-patch branch, in order to show the changes from one patch to another. It really helps to see what work someone is doing when posting a patch. When you are doing a reroll, an interdiff isn't necessary because there are too many changes. At all other times, interdiffs make life easier! Thanks!
Comment #92
rainbowarrayHelps if I post the link: https://www.drupal.org/documentation/git/interdiff
Comment #93
dcrocks commentedThanx for the pointers.
Comment #94
dcrocks commentedI am trying to get my head around this problem with the update. If @longwave is right the blocks are already disabled when the update fires and that's why the test fails. The impact should be that the user sees a bunch of standard blocks in their 'disabled' blocks list and a empty header region in Bartik. If the toolbar is not turned off, it is relatively easy to fix things up. But if not, and for other profiles than the standard one, things aren't quite so simple. So is there any place else to handle this, perhaps in theme handling or info file processing?
Comment #95
longwaveRebased #86 as block_update_8001() is now taken. If I remove block_rebuild() entirely then the failing test passes, but that is obviously not the right solution - but I am also not sure what the correct thing actually is.
Comment #97
lauriiiAccording to test bot it seems to be opposite :P
Comment #98
dcrocks commentedNeither patch actually includes the HeaderRegionRenameUpdateTest.php, so no surprise the first passed.
Comment #99
lauriiiThere is a long discussion which has been happened when this was done: #1869476: Convert global menus (primary links, secondary links) into blocks so this wasn't done by a mistake which I was assuming in the first place. The reason it was done in the first place was that we used to have an UI for selecting primary menu and secondary menu which are being outputted in the variables and we didn't want to remove. To support that we created them as separated regions so that themes could theme their menus according what's inside that region and site builders could change the menu inside the region. Apparently people don't know how it work. It was super confusing and even I couldn't figure out how I'm supposed to use those regions before reading the original issue. I think we either need to add a help text there or rename the regions at least on the UI so that its clear what they are there for.
Comment #100
longwaveThat's what I get for trying to post patches in a hurry before going to sleep. This is #95 with the missing test added back.
Comment #101
longwave#1869476-187: Convert global menus (primary links, secondary links) into blocks and #1869476-188: Convert global menus (primary links, secondary links) into blocks certainly do make good arguments for the way things currently are, and after scanning that entire issue there seems to be no single perfect solution that will please everyone. Maybe the current setup is the least worst option, and adding help text to explain the use of Bartik's regions would improve things? Header first/second/third may remove some of the confusion but that does not follow that it will necessarily make the blocks page any more usable.
Comment #102
lewisnymanWe have a three competing objectives here:
I think we can solve the first three by renaming the regions to follow best practice, then adding a custom class to these regions that have no relation to the region name. This means the menu styling is still triggered by placing the block in the region but it is still reusable elsewhere.
The final objective, we could improve using some help text, a tooltip, or tour. That feels like a separate issue to me.
Comment #103
dcrocks commented#2502045: Replace the "Primary menu" component with a reusable component in Bartik. and #2502049: Replace the "Secondary menu" component with a reusable component in Bartik. are meant to address part of @LewisNyman's comments in #102. This issue was supposed to just address the region renaming.
Comment #106
dcrocks commentedThis has been sitting for a while. I don't think I quite understand the update process but if we simply update the block config but the theme definition hasn't been updated we will still have a mismatch between the block region designation and the theme's region definitions. What I would expect that for any block configured for a region that doesn't exist in a given theme the block would be placed in the theme's default region, which, I think, is the 1st region defined in that theme's info.yml. And unless the theme has the old region names, we can't mess with it. Even then we aren't really sure what the consequences of that change would be on the theme. So, is it actually possible to have an update mechanism for this change?
Comment #107
dcrocks commentedIt seems to me that we can't do any updates to custom themes as we don't know the themer's intent. All we can update is the bartik theme, and even there we might step on some local modifications. And the test added only tests the bartik theme anyways. So I modified the update to just do a forced update of the bartik account menu and main menu blocks.
Comment #108
dcrocks commentedduh
Comment #109
dcrocks commentedSmall typo, big fail
Comment #112
dcrocks commentedWhy didn't we get this earlier? Just duplicate dpattern of other updates.
Comment #113
dcrocks commentedduh again
Comment #115
dcrocks commentedNeed to finish. There will be multiple patches affected by #2555183: Fix the filled update tests, they are broken.
Comment #117
dcrocks commentedanother typo, but I'm concerned about all the other errors.
Comment #118
tim.plunketta) The other two update hooks use the config objects directly, bypassing the entity system. Why doesn't this do the same?
b) If you continue to load the entity, please do it like
Also, a lot the "needs" tags can be resolved without the intervention of others (like BE and IS update), and will actually help others review this.
Comment #119
andypostjust a nit
indent wrong, also better to use Block::load()
Comment #120
dcrocks commentedThis is a reroll after #507488: Convert page elements (local tasks, actions) into blocks and for the recommendations in #118. I would like to take a stab at using config instead of the entity system but I wanted to try this first.
Comment #121
dcrocks commentedKnow that will fail, so trying again.
Comment #123
rainbowarrayIf we can get it in, #2005546: Use branding block in place of page template branding variables (site name, slogan, site logo) will affect what content is in the header. That's RTBC, so a heads-up.
Comment #124
dcrocks commentedThis is not the only one impacted. It would make sense for #2005546: Use branding block in place of page template branding variables (site name, slogan, site logo) to go in first.
Comment #125
dcrocks commentedI don't know the original decision to use the entity system came about but what would be the advantage of using config objects over the entity system?
Comment #126
tim.plunkett$entity->save() dispatches events and invokes hooks. Those can be unsafe during update.
Comment #127
dcrocks commentedUsing config instead of entity
Comment #128
tim.plunkettThere are a *lot* of "needs" tags on this issue...
Fixing the coding style of the last patch.
Comment #129
dcrocks commentedSorry. I was planning on doing that when this needs a re-roll, as I expect #2005546: Use branding block in place of page template branding variables (site name, slogan, site logo) to go in first. Should probably remove "use Drupal\block\Entity\Block;" from block.install as well. I can remove tags but I didn't add them so I'm leery about changing them.
Comment #130
dcrocks commentedThis is a re-roll after #2005546: Use branding block in place of page template branding variables (site name, slogan, site logo). Some images included.
Comment #133
dcrocks commentedThis won't fix the fail, just doing a little clean up.
Comment #134
dcrocks commentedOk, now needs review and change record.
Comment #135
rainbowarrayWe're naming these regions numerically, but the order is 2, 3, then 1?
It seems like the region number should match the source order.
header_second is used twice here. Should the first one be header_first?
Comment #136
dcrocks commentedThis is the order in Bartik and matches the placement of the blocks in Bartik. It is not the same order in page.html.twig files in system or classy. It is the order that @emma.maria had asked for back in #42.
Comment #137
davidhernandezmdrummond's comment wasn't about the name of the regions, but the order and placement in the template. It indeed looks wrong. They should be in order and not duplicated.
Comment #138
dcrocks commentedWhen I 1st set it up I was thinking in terms of the content more than the region. This patch changes all core page.html.twig templated to have the same order,
Comment #143
manjit.singh@dcrocks should not the order be same for bartik as well ?
Comment #145
dcrocks commentedThe header regions appear in the same order in all of the core page.html.twig files; system. classy, and bartik.
Comment #151
dcrocks commentedSpent too much time looking at wrong ThemeTest.php.
Comment #153
dcrocks commentedSmall change but faster thn waiting for 151 to finish
Comment #154
dcrocks commentedWell I know that will blow up because somebody else grabbed update 8003
Comment #155
dcrocks commentedQuick fix
Comment #157
rainbowarraySomething to think about:
- You may want to check the block configs for the minimal and standard profiles to check which regions each block is being placed into: those may need to change so they still show up in the right spot.
- We'll probably need an upgrade path for this. We can't do much for custom themes, but we can check for Stark, Seven, Classy and Bartik to move blocks in regions whose names are changing to the corresponding new regions that take up the same place in the layout.
Comment #159
dcrocks commentedNote that seven has only one header region and that wasn't touched by this patch. Classy and stark inherit the default theme definitions in ThemeHandler.php.
Using a git clone of 8.0.x and applying the patch, after install:
On a minimal install:
stark is the default theme and its blocks are assigned regions as configured.
All the other themes are in the 'uninstalled' state.
When installed they will inherit blocks from whatever blocks are in the current default them plus 'Site Branding' which is placed by system.install.
On a standard install:
Bartik, Classy, and seven are in the 'installed state' and blocks are assigned as configured.
Classy has no blocks assigned to any region, which is as designed.
Stark is in the 'uninstalled' state and when installed will pick up whatever blocks are assigned to the current default theme in the corresponding regions, if it exists.
The only possible additions I can see at this time is to have additional blocks, such as primary or secondary menus for stark, placed by system install.
There is a minimalist upgrade path and I'm not sure how it can be added to.
Comment #161
dcrocks commentedRe-roll to include changes from #2503755: Switch from user login block to login menu link and search block in standard profile and some before and after shots.
Comment #164
dcrocks commentedI just noticed that RC1 has arrived. Given that, this patch will be much more disruptive since the number of users will be much higher than the number on the betas, and also probably less experienced. Much as I hate to say it, it might be better to postpone this.
Comment #167
longwaveUnfortunately, this does not appear to meet the allowed changes criteria for 8.0.x now, so I agree this must be postponed until 8.1.x.
Comment #170
dcrocks commentedComment #171
davidhernandezYou don't have to actually postpone it. It can still be worked on, just not committed. The change in version is the clear indicator that it would not get committed to 8.0 and have to wait to be added to 8.1.x-dev.
Though, admittedly, I'm not sure this could even go in 8.1. Changing the default regions is a change that we can only provide limited backwards compatibility for. We might have to leave that change for 9. All the changes to Bartik and Seven we can make though to some version of 8 after release.
Comment #172
dcrocks commentedDoesn't look like 8.1.x is synced with RC so can't work on that branch at all and as long as issue assigned to 8.1.x can't work on it as 8.0.x either.
Comment #174
joelpittetI think/hope we can do this in 8.2.x. The plan though is that we can't change classy or stable. But all other themes/core is fair game.
This should be a good test of how much we can test in the name of UX for the themes we want to improve and for core and still giving backwards compatibility for 8.x
Comment #175
joelpittetHere's a reroll of #161
Comment #177
dcrocks commentedAnother reroll of 161
Comment #179
joelpittet@dcrocks Thanks that re-roll looks better than mine.
Comment #180
joelpittet@dcrocks Could you remove the classy and stable bits of this patch?
Comment #181
dcrocks commentedSo you want classy and stable to maintain the old region names? Neither classy nor stable specify regions in their info.yml but they have templates that do. I don't expect issues but I guess we will have to wait and see.
Comment #182
dcrocks commentedThis will probably not fix everything. I'd like to add that this would be easier if non-stable themes were not used in testing unless they themselves were being tested.
Comment #184
dcrocks commentedThis has turned into a real mess. Reverting classy to use the old region names has created all kinds of conflicts. It made tests that use classy now fail because the page.html.twig file has the old names and I have to find and revert all those tests. This also affects tests that use stark because it inherits from classy. But that is not the hard problem. Since the existing block yml files are actually written for bartik, if they are run in tests that use classy(or stark) as the theme, the tests fail. I'd like to restart and make this a bartik only change but for the problem with the block yml files. If #2642590: Move Bartik block config into the Bartik theme and its brethern were in, it would make any solution here safer for the long run.
So, bartik, classy, stable, and system all carry these region definitions around in page.html.twig, plus some core block yml files that are designed for bartik(eg. system branding) but used in tests with other themes. Honestly, I'd prefer they all used the new names because they are more generic and not bartik centric.
Comment #185
dcrocks commentedI know we can't modify classy and stable, and we probably shouldn't touch any templates in system module as well. I could redo this and focus just on bartik. That means bartik would look very different from default region setups in the rest of drupal core, including the default region definitions in ThemeHandler.php. Maybe that's for the better, maybe it will just create confusion, and maybe it's not worth the effort.
The original issue scope really was to change this in all of Drupal. If that is still the intent, then maybe this has to be moved to 9.x.
ps. If this is done in 8.x I would like to change the tests impacted by this change to NOT use bartik unless they actually have to. Its a pain to have to fix tests because they chose a moving target for a theme and don't really see a functional change.
Comment #186
dcrocks commentedTo be clear, I am looking for input as to whether to continue with this or not.
Comment #187
dcrocks commentedI am going to mark this as postponed and for 9.x for several reasons:
The old region names are already embedded in existing 8.x sites.
The original issue posed this as a core wide change. Having both the old and bartik specific regions names will probably lead to some confusion(and cursing). If this is done for Bartik only, then themes that think they are inheriting bartik's menu blocks will find them disabled because the block's menu regions don't exist in the new theme's layout.
Comment #188
catchThis is still worth trying in a minor release, moving back for now.
Comment #201
steinmb commentedSee no reasons for this to be postponed.