Hello!

Would it be possible to allow the node's editor to specify a different menu title to the node's title?

For example, when I add a page to a menu, the menu entry might be "Contact us", while the page's title might be "Get in touch with the IT Support team", which is far too long for a menu.

This is a bit of a deal-breaker for me unfortunately, as we only have limited space in our template for menu entries and they have to be concise to maintain good usability for our users.

If anyone could offer any help, it would be very appreciated!

Many thanks,

Alex

CommentFileSizeAuthor
#8 nh_token.patch5 KBmeecect

Comments

ronan’s picture

You can edit menus after the fact and nodehierarchy will not interfere. Nodehierarchy will only overwrite your custom menu title if you check the 'recreate menu' item when saving a node. This is by design to allow the very thing you're looking for.

Hope this helps
Ronan

alexgreyhead’s picture

Hi Ronan,

The problem I think I found was that the "automatically recreate menu" checkbox is always checked by default when that functionality is enabled. Also, the lack of an option to set the menu title adds an extra unnecessary step to the workflow to create content which further complicates the process of creating content.

In my mind's eye, I imagine the way to avoid the problem would be to add a text field along the lines of "Enter a menu link or leave blank to automatically use the node title" - could it be done?

Thanks for your reply :o)

Al

ronan’s picture

Sounds like maybe you have automatic menus set to 'always' or 'optional - default yes' instead of 'optional - default no'.

I do need to improve the interface for creating menu items (like putting the checkbox over near the menu settings for example) but I'm not sure exactly how I want to do it right now. I've some other request to change this interface, and It'll be difficult accommodate all needs without making it overly complicated and confusing. The point of the feature is to allow you to quickly create a menu item for the node with the same title and place in the hierarchy. For anything more complex I'd really like to allow users to just use the built in menu editing interface.

Thanks
Ronan

alexgreyhead’s picture

Ronan, you are spot on - I completely forgot about the "optional - default yes" setting. Might this be a good time to request a small tip/helper reminding users to set this value when choosing whether auto menus is on or off please?

Jean-Philippe Fleury’s picture

Hi,

I really agree with alexharries.

Node Hierarchy is a very good module for hierarchical site, but if we would be able to set menu title at the time of creation of the node, it would be wonderful.

meecect’s picture

Maybe there is a clever way to use Views to get this function. I know I'm dying for the ability to change how that menu gets generated. For me, I would actually want it to put the node title inside an 'a' tag that links to the node edit page. In my site, the auto-menu function is used to generate a block that has all the hierarchical content that the user has created, and they are primarily editing, not viewing. Since I used admin theme, the way it is now is they click the link, which takes them to the 'live' site view, and then they have to click the 'edit' tab which takes them back to the admin-themed side to edit. It's a bit jarring and they complain about it all the time.

Even if you can't change it, I would appreciate any advice from Views masters on maybe how to recreate the hierarchical menu directly in Views, and bypass the auto-generating menu. I would just uses a View in a block. In fact, that might be a route in general that people can use to customize the display.

garretg’s picture

One simple solution is to define a "longtitle" cck field for the node's content type. Use the "longtitle" for the page title... but use the node title for most other places (menus, breadcrumbs, etc.).

You can make it an optional field, to be used only when the short title that is suitable for menus and breadcrumbs is not fully descriptive. Just make your site templates check for a non-empty node->longtitle... If set, display that as the page title. Otherwise just display $title.

meecect’s picture

StatusFileSize
new5 KB

I created a patch that might help for this.

With the patch, if token is installed, new options will appear on the nodehierarchy settings page for each node. In particular, you can specify a pattern for both the link and title for menu item generation. If you don't specify anything then it defaults to [title-raw] and node/[nid], which is the same behavior when token is not installed.

Unfortunately, I don't think there is any graceful way to handle the cases where one might have had a large menu structure previously, with the old behavior, and then one starts using custom tokens, because there is no way for the module to know which parent it should be looking for.

The module currently looks for something like /node/$nid and then considers that the correct parent. This is fine, but if you then use my patch and change the menu item link path to something like node/[nid]/edit (in my case), then when it looks for parents, it will look for node/$parent_node->nid/edit, which it wo't be able to find.

Otherwise it seems to work very well.

The only way around the issue I mentioned, btw, is to perhaps store the appropriate menuid in the nodehierarchy table rather than looking in the menu table for a matching path.

bkosborne’s picture

I feel that when automatically create menu item is set to always, the menu fieldset option should be completely removed using form_alter, and an option should be given for a custom title right in the node edit/add form.