0

I'm having a bit of a problem when using multiple aliases regarding which alias appears on a menu.

For example, I have create a page /node/1, give it an alias /page1 and add it into the navigation menu.

Browsing to the index page I can see the page in the navigation at /page1.

I also want the page to be available at another alias /page2 so I add this through the URL aliases functionality. Unfortunately this updates my menu so the link in the menu now points to the URL /page2 instead of /page1.

If I have multiple aliases to a node, how does Drupal decide which is used in a menu and how can I change this

2

When multiple aliases are available, Drupal uses the most recently created (as determined by the pid column in the url_alias table).

I don't know an easy way to change this behavior. You could try manually altering the pid value in the database. Also consider if using a redirect is a better solution than aliasing.

  • This helps. So if you want your original alias to keep on being the main alias, delete it first. Add your alternative aliases. Then add your original alias again (fe by editing the node and changing it there). Clear your menu cache et voila. Tried this. – commonpike Jan 31 '18 at 12:13
1

To avoid these multiple aliases issue, you can directly give the node/[nid] path in menu items which will be static always.

  • If you want to add a link to your website, do it in the "About" section of your profile, not in questions/answers. Please read the FAQ – Laxman13 Oct 10 '11 at 12:56
  • This is wrong and should be downvoted! Drupal ALWAYS stores the internal path in the menu, even if you provide an alias it will still store node/nid – Angry Dan May 30 '13 at 10:39
1

When I faced the same problem, the only I solution I found was to use absolute (starting from http://) menu paths (i.e www.example.com/page-1), which are stored in Drupal's menu system as is, not as internal paths

0

You could use :Nodesymlinks. The answer of @Valery Lourie also is looking valid.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.