WordPress.org

Make WordPress Core

Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#13213 closed task (blessed) (fixed)

Add Home option to Nav Menus

Reported by: LesBessant Owned by: filosofo
Milestone: 3.0 Priority: normal
Severity: normal Version: 3.0
Component: Menus Keywords: has-patch ux-feedback
Focuses: Cc:

Description

As mentioned in this support forum thread:

http://wordpress.org/support/topic/394541

While it's easy enough to create a custom link with the site URL, a built-in "home" option would enable the use of the current-menu-item class.

I see this was previously requested in #12713, but as that ticket is closed, I'm adding it here - I haven't found another ticket covering it.

Attachments (3)

non-js-add-home-link.13213.diff (3.0 KB) - added by filosofo 4 years ago.
non-js-add-home-link.13213.2.diff (8.0 KB) - added by filosofo 4 years ago.
non-js-add-home-link.13213.3.diff (8.8 KB) - added by filosofo 4 years ago.

Download all attachments as: .zip

Change History (21)

comment:1 LesBessant4 years ago

  • Component changed from General to Menus
  • Owner set to filosofo
  • Type changed from feature request to enhancement
  • Version set to 3.0

comment:2 nacin4 years ago

  • Milestone changed from Unassigned to 3.0
  • Type changed from enhancement to task (blessed)

comment:3 filosofo4 years ago

  • Owner filosofo deleted
  • Status changed from new to assigned

comment:4 nacin4 years ago

[14439] -- More menu improvements. Add link that adds a menu item to the home page, make empty menu dropzone slightly larger, limit selected items to the active tab. props koopersmith and ptahdunbar. see #13220.

Does not yet work for JS. I think koopersmith has an idea on how we can do that easily.

comment:5 nacin4 years ago

I meant non-JS. Does not work yet for non-JS. Works great for JS.

comment:6 nacin4 years ago

Also, as discussed with ryan and others, we need to work through the front end walker and check all custom links against the current URL for adding current-menu-item classes. That would include a Home link and any other.

comment:7 nacin4 years ago

  • Resolution set to fixed
  • Status changed from assigned to closed

(In [14457]) Check custom links, including a home link, against the current URL to see if we should add current-menu-item. props ptahdunbar, fixes #13213, see #13220.

comment:8 duck_4 years ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

Still not working for non-JS.

comment:9 nacin4 years ago

  • Keywords needs-patch added

We either need to hide-if-no-js, or preferably make it a nonce link that can add it.

comment:10 filosofo4 years ago

  • Owner set to filosofo
  • Status changed from reopened to accepted

I'll make it work sans js

comment:11 filosofo4 years ago

  • Keywords has-patch added; needs-patch removed

Patch lets you add a home link with no js enabled.

comment:12 nacin4 years ago

Tests fine, but I doubt we want to make that a button, unless we style it differently (perhaps like a link). We could do a nonce URL instead. I suppose we should ask if Jane has wanted it as something other than a link all this time, though.

comment:13 jane4 years ago

Dev chat discussion led to this implementation decision: Make Home just another 'page' in the checkbox list in the pages box. That's how users think of it. No separate link at all.

comment:14 nacin4 years ago

  • Keywords ux-feedback added

UX thought -- Should we really be adding this to the top anymore? Now that it's built into Pages > View All, it makes sense to follow the normal flow. That said, as discussed in IRC, it seems we ought to differentiate it a bit anyway, maybe with an icon, or "(home)" appended in gray text, or a divider, something.

comment:15 jane4 years ago

Per dev chat:
As long as Home is at the top of the checkbox list, I don't care if it adds to top in the actual menu. Is fine not to, since would be at top for a new menu, which is when it would most matter.

I don't think Home should get a different visual treatment.

comment:16 nacin4 years ago

  • Resolution set to fixed
  • Status changed from accepted to closed

(In [14971]) Move the "Add Home Link" functionality to a checkbox on the View All tab of the Pages metabox. Also makes it work non-JS. props filosofo, fixes #13213.

comment:17 follow-up: kanuck544 years ago

I just thought it might be mentioning that as a long-time WordPress user, new to 3.0, this was not at all discoverable. This is the only place I actually found the information I was looking for! And it just feels very hacked in — the way it shows up as "custom," the way it's just my URL in the URL box. I think you can do better, IMO.

Still, this new menus feature in general is wonderful. I can see myself making extensive use of it!

comment:18 in reply to: ↑ 17 kanuck544 years ago

(I just thought it might be worth mentioning. Typo!)

Note: See TracTickets for help on using tickets.