Convert primary and secondary menus to blocks

kika - June 27, 2009 - 10:18
Project:Drupal
Version:8.x-dev
Component:theme system
Category:task
Priority:normal
Assigned:Unassigned
Status:needs work
Issue tags:d7uxsprint, Usability
Description

This is a placeholder issue to start working on converting primary and secondary menus to blocks.

Usability use case: http://sprint.drupalusability.org/content/main-menu-can-show-two-places

Background: http://hojtsy.hu/blog/2009-apr-09/mission-improve-page-regions-drupal-7 :
"3. Special main and secondary menu display of themes. Again, these are *already blocks*. Themes can just theme them differently when they are in their designated regions. Again, less theme settings, more visibility control, being able to swap menus in sections of the sites via other menu blocks, and so on."

#1

kika - June 27, 2009 - 10:21
Title:Convert primary » Convert primary and secondary menus to blocks

Fixing title

#2

berenddeboer - June 27, 2009 - 14:34

I think this is a bad idea. The whole concept of primary and secondary menus should go. It is a theme setting, and should be a theme option.

Also note that secondary menus can appear as child menu (below) the primary menu. This is a feature that's not possible with this solution. I agree that this whole feature should be scrapped, but you need to be aware it exists as themes must be changed to support this removal.

#3

catch - June 27, 2009 - 15:09
Status:active» needs review

Here's start on removing this feature. Removed from everywhere I could find, CNR for the test bot.

AttachmentSizeStatusTest resultOperations
remove_primary_secondary.patch9.72 KBIdleUnable to apply patch remove_primary_secondary.patchView details | Re-test

#4

kika - June 27, 2009 - 15:13
Status:needs review» active

The proposal:

- Primary links (now called just a block "Main menu") should support 2 level tabbed navigation out of the box. No more super-confusing tricks under "Source for the Main links" and "Source for the secondary links" settings under Menu settings. (there is an initiative to fix that page #503778: Global Menu settings are confusing but is is pretty hopeless). Also part of this is upcoming patch is to move default node/add menu selection setting under content type editing.

- Secondary links: it's an open question what do do with them. Depreciate? Latest D7 replaced "Source for the secondary links" with user links so they are out or user's "visual radar"

- What about upgrade path?

#5

kika - June 27, 2009 - 15:15
Status:active» needs review

putting status back

#6

catch - June 27, 2009 - 15:18
Status:needs review» needs work

Forgot about user links being in the secondary links. Back to CNW - need to sort those out somehow if we do this.

#7

kika - June 28, 2009 - 15:34

This is how it would structurally work (screenshot attached).

A design decision:

1. we keep link sourcesettings admin/build/menu/settings for now (fixing it in followups), just renaming them to

"Source for primary links" -> "Source for main menu block"
"Source for secondary links" -> "Source for secondary menu block"

#8

kika - June 28, 2009 - 15:39

Added shot.

Another design decision: we always pass all the menu items inside blocks -- any depth -- to a page_alter() and theme layer.
We theme "Primary links" theme region so it nicely supports two levels of tabs, if you have 3+ depth menu in "Primary links" region, you will need a theme what supports it or nicemenu module

AttachmentSizeStatusTest resultOperations
primary_secondary_blocks_1.png95.49 KBIgnoredNoneNone

#9

stephthegeek - June 28, 2009 - 22:29

A big +1 on this. It's a huge source of confusion for newbies ("why do i have two primary menus?") and is more consistent with the way other 'special' elements like mission and footer_message are also becoming blocks in D7.

So do these blocks have titles off by default?

#10

kika - June 29, 2009 - 19:44

Correct, no titles.

#11

SeanBannister - July 3, 2009 - 02:44

This is great, should simplify things a little more and make it easier to move menus around the site.

#12

rickvug - July 7, 2009 - 02:40
Issue tags:+Usability

Makes a lot of sense to me. Converting the menus to blocks removes special casing (improving usability) and is more flexible. It also dovetails nicely with #351249: Finer control over the Parent Menu select box. The combination of these two patches would allow for the removal of the confusing menu settings page.

#13

kika - July 16, 2009 - 09:14

We might need to look at #511284: Add html_top and move the admin toolbar into html_top implementation.

#14

dodazzi - February 1, 2010 - 18:31

This is an updated patch.

Removed from everywhere I could find the main and secondary links feature. (mostly from the patch in #3)
(In Garland) Created a 'navigation' region via garland.info (Do I need to add regions[page_top] & regions[page_bottom] explicitly as I did?).
(In Garland) Put 'main menu block' inside the newly created 'navigation' region. Via system.install
(In Garland) Put 'secondary menu block' inside the 'footer' region. Via system.install
(In Garland) Whatever menu block you put inside the 'navigation' region is styled like primary links in D6 and supports two levels menu out of the box. Second level menus are styled like the secondary links in D6. You can assign more than menu block to the navigation region. They won't break but live side by side.
(In Garland) Whatever menu block you put inside the 'footer' navigation is styled horizontally and supports two levels menu.

Notes:
I had to modify Garland CSS to have this working but I haven't been able to test this modification in IE on windows (especially IE6).

Let me know if you like this approach and have a look at the code.This is my first big patch. I'm pretty sure I'm missing something huge. Be kind.

AttachmentSizeStatusTest resultOperations
primarymenu.patch16.11 KBIdleFAILED: [[SimpleTest]]: [MySQL] 16,312 pass(es), 1,104 fail(s), and 32 exception(es).View details | Re-test

#15

dodazzi - February 1, 2010 - 18:33
Status:needs work» needs review

These are some (hopefully) explanatory screenshots.

AttachmentSizeStatusTest resultOperations
primarylinks.gif50.5 KBIgnoredNoneNone

#16

dodazzi - February 5, 2010 - 15:01

How long does it take to have a patch tested from the testbot? I posted the patch on February 1st. I wonder if there's something wrong in the patch...

#17

yoroy - February 7, 2010 - 10:06

It seems testbot is having problems, not your fault.

#18

System Message - February 9, 2010 - 22:30
Status:needs review» needs work

The last submitted patch, primarymenu.patch, failed testing.

#19

dodazzi - February 9, 2010 - 23:15

1104 fails! Wow! It was better when the testbot didn't work. I guess I'll have to browse the documentation to understand what all those fails mean.
Anyhow I won't be able to bring home this patch alone. Is there anybody out there willing to review, at least the approach taken?

#20

yoroy - February 9, 2010 - 23:34

As far as I can tell this is Drupal 8 material, we're only fixing bugs for D7 now, not changing/reworking features anymore.

#21

jide - February 10, 2010 - 03:46

I don't see it as a new feature and it does not change API, so this seems as D7 material to me.

Edit : forgot the "not", uh.

#22

jide - February 10, 2010 - 03:44
Status:needs work» needs review

.

#23

catch - February 10, 2010 - 03:58
Version:7.x-dev» 8.x-dev
Status:needs review» needs work

People are already porting themes to Drupal 8, and those almost invariably use the primary and secondary links variables, so it's an API change for themers, if not for module developers. So also think this is Drupal 8 now - although it should go in really, really early if at all possible since these are now even more inconsistent with other template variables now that help and mission have been moved to blocks.

 
 

Drupal is a registered trademark of Dries Buytaert.