Hello,
So, I have pathauto enabled, and I am going through the motions of setting up a really simple website where the account_admin can made new nodes, and assign them to the primary menu all on their own, from the node creation screen.
When they type in the box the menu title [say the name is: 'foobar'], and the checkbox for "create pathauto alias' is on, I get the following result:
-=-=-
Menu item:
Title: foobar
Path: node/8
Alias created:
Alias: content/foobar
Path: node/8
-=-=-
The alias works, but the problem is, that the menu item should have in it:
Title: foobar
Path: content/foobar
and NOT
Path: node/8
As this completely defeats the point of making an alias... because the entire menu has in it numbers instead of alias's...
Is this just a bug [oversight] in path auto & the menu system?
Or do I need to turn "on" something that is not on by default to get it to work?
Thanks for your help!
Sebastian.
Comments
Comment #1
schedal commentedhello, still wondering if anyone can provide some insight, is this a limitation in pathauto? Or do I need to change some other config to make this work? Your help is really appreciated; thanks!
Comment #2
gregglesWhen you create a menu entry the "Path" used in the menu entry should generally be the internal system path like "node/8". This keeps Drupal consistent if the alias for node/8 changes later on.
The important part: when menu items are displayed Drupal should change them from the "node/8" format into whatever their alias is. If your site doesn't do that then there is a bug somewhere in your site. Are you using any other modules or a custom theme?
Comment #3
schedal commentedHi, there is indeed something odd going on, because the site's menu links do not change to match the pathauto-link names.
The theme is a custom theme, which is very simple, but I did build it from scratch -- so that it would match one-to-one the design that they were using before I converted their website into drupal [before that it was a simple HTML+PHP site], and I am indeed using other modules beyond core, but nothing exceptional IMHO.
Would it be helpful for me to post what modules I am using?
Or is there something in my custom theme that I need to include, to permit the path-auto links to appear instead of the hard-coded ones? On that note: I am generating my menu using the following code:
The code is written in this way, so that the resulting HTML is identical to how it was pre-Drupal, so that there were in actuality zero required CSS changes needed after the porting.
Could this be the problem?
Thank you kindly for your help!!
Sebastian.
Comment #4
dave reidWhat are your node alias patterns from admin/build/path/pathauto?
Comment #5
schedal commentedHi Dave, nothing has changed from default, it lists:
Comment #6
dave reidI think
$href = $link['href'] == "<front>" ? base_path() : base_path() . $link['href'];should be using:
$href = url($link['href']);That way it will auto-alias the link for you. Also takes care of
<front>Comment #7
gregglesOr even turn:
Into this:
Which has the benefit of doing a check_plain on the $link['title']. This is in the README.txt, btw.
Comment #9
schedal commentedThank you both for your replies! Sorry for my slow response, other projects were usurping my time. Much appreciated Dave and Greggles!
BTW my PHP code was an edited version I grabbed from a theme (I think it was Nitobe, but I could be wrong) -- my bad for not verifying if they were using Drupal compliant syntax standards.
Comment #10
gregglesGreat, thanks for the feedback.