Jump to content


Photo

non clickable parent objects in navigation menus. # causes 404 when used with custom permalinks?


  • Please log in to reply
11 replies to this topic

#1 jingram

jingram

    Advanced Member

  • Members
  • PipPipPip
  • 90 posts

Posted 14 March 2012 - 07:41 PM

So here is the deal. I have some navigation menu parent objects that I want to be unclickable and yet still have clickable child objects. In the old days, in Wordpress, I would simply create a custom menu and use that as the parent objects and then blank the url. Then I would link whatever child objects I wanted via their pages and put them in the order I wanted.

A couple of releases of wordpress back, this stopped working. Well, it worked fine, but it broke the style of the menu. See this link here.

http://www.pagelines...3-update#Item_7

Danny recommended putting in # as my option instead and that took care of it. However, with my last wordpress upgrade it appears that those items are now clickable again and it takes you to a 404 error page.

When you put the # in the custom menu it looks like it creates a link back to this:

 http://www.adventurekayaking.org/<?php echo get_settings('home'); ?>#

So after much investigation and troubleshooting, it appears that this is being caused by custom permalinks.

When we switch back from custom permalinks to default it seems to work fine. We aren't doing anything too crazy here. Our custom permalinks being used are below.

/%post_id%/%category%/%postname%/

Any ideas?

#2 Simon_P

Simon_P

    Messer

  • Administrators



  • 8388607 posts
  • LocationDevon
  • Framework Version:2.1.1
  • Country: Country Flag

Posted 14 March 2012 - 07:57 PM

You are putting php into the menus?

#3 Rob

Rob

    One Smart Egg

  • Members
  • 13575 posts
  • LocationEast Coast, USA
  • Framework Version:The Latest, of course
  • Country: Country Flag

Posted 14 March 2012 - 08:08 PM

I tested this setup with the exact custom permalink you stated, added a parent with # in the URL field, then a child below it. I saw no down arrow for the child menu items but I did not see the php. When clicked, it the tested parent did nothing. A bug report was submitted.

#4 Rob

Rob

    One Smart Egg

  • Members
  • 13575 posts
  • LocationEast Coast, USA
  • Framework Version:The Latest, of course
  • Country: Country Flag

Posted 14 March 2012 - 08:21 PM

Go to Dashboard > iBlogPro > Theme Options > Header And Nav... there you'll see a check box for Drop Down Navigation. Check it and your menu will work. Thank you Simon for a brilliant job of deduction!

#5 jingram

jingram

    Advanced Member

  • Members
  • PipPipPip
  • 90 posts

Posted 14 March 2012 - 08:26 PM

Take a look at the site guys... NO php is not in the menus and YES sub menus work fine. I've been using iBlog4 Pro for over a year now. I'm not totally new to this stuff, lol. When you hover over the parent menu I see the php code included above meaning that is what the menu is trying to link to. When you click on the parent link it returns the 404 page. However, that only happens when you use custom permalinks as stated above. When you use default permalinks it does nothing and stays on the current page like it is supposed to.

#6 jingram

jingram

    Advanced Member

  • Members
  • PipPipPip
  • 90 posts

Posted 14 March 2012 - 08:32 PM

For example, on the site, the first Parent Menu Item is Trips and Adventures. Right now this is a custom menu and is setup to point to # When you click on that parent menu it returns a 404 and the page it is returning the 404 against is the link/code snippet I included above. Again, this only happens with the custom permalinks I specified above. If you switch to default permalinks everything works fine.

#7 Simon_P

Simon_P

    Messer

  • Administrators



  • 8388607 posts
  • LocationDevon
  • Framework Version:2.1.1
  • Country: Country Flag

Posted 14 March 2012 - 08:33 PM

Take a look at the page source, you will see this:
 <base href="<?php echo get_settings('home'); ?>" /


#8 jingram

jingram

    Advanced Member

  • Members
  • PipPipPip
  • 90 posts

Posted 14 March 2012 - 09:21 PM

So what do you think is happening?

#9 Simon_P

Simon_P

    Messer

  • Administrators



  • 8388607 posts
  • LocationDevon
  • Framework Version:2.1.1
  • Country: Country Flag

Posted 14 March 2012 - 09:53 PM

Well, you have added the above piece of code somewhere expecting it to be parsed as php, when it isnt. I have no idea where you added it.

#10 jingram

jingram

    Advanced Member

  • Members
  • PipPipPip
  • 90 posts

Posted 14 March 2012 - 10:20 PM

I can tell you that I definitely didn't add it... would a plug-in do this? Why would the issue go away when switching to default permalinks? On another note, it only seems to impact Chrome and Firefox. IE9 does nothing. Behavior as expected.

#11 Simon_P

Simon_P

    Messer

  • Administrators



  • 8388607 posts
  • LocationDevon
  • Framework Version:2.1.1
  • Country: Country Flag

Posted 14 March 2012 - 10:35 PM

could be a plugin, i have no idea.

#12 jingram

jingram

    Advanced Member

  • Members
  • PipPipPip
  • 90 posts

Posted 14 March 2012 - 10:59 PM

Well I stand corrected, I found the code buried in the http header scripts section. Looking back through some cases I had opened up about my original challenge with non clickable parent menu items it appears that the old method use to be going custom, blanking out the url for the menu item and inserting said code in the header scripts section. Thanks for brainstorming this with me guys, much appreciated. Feel like a bit of a tool, but such is life I suppose. It makes it challenging when the behavior is so erratic across platforms and when seeminly unrelated things like the permalinks changes produce the desired behavior.