Share » Forums » Setup & design » removing primary/first level menu...

removing primary/first level menu redirects out of a treemenu

removing primary/first level menu redirects out of a treemenu

Thursday 22 April 2004 9:57:56 am - 5 replies

Author Message

Alex Jones

Saturday 24 April 2004 8:05:21 am

This should be easy enough to do. Are you using JavaScript to expand the menus? If so, just modify the code for the First Level to display

href="#" onmousover=YOUR MENU CODE"

instead of

href={concat("/content/view/full/",$:item.node_id,"/")|ezurl}

Leave the Second Level Code the same. One note, the best way to do it would be to leave the <i>href={concat("/content/view/full/",$:item.node_id,"/")|ezurl}</i> and add <i>return false;</i> to the end of the JavaScript placed in the mouseover.

href={concat("/content/view/full/",$:item.node_id,"/")|ezurl} onmouseover="YOUR MENU CODE;return false;"

While the vast majority of users will only see the menu, this ensures that your site is still accessible to anyone who has disabled JS in their browsers, including search engines. But it does mean that you will have index pages - they will remain unseen for most people.

Does this help?

Alex

Alex
[ bald_technologist on the IRC channel (irc.freenode.net): #eZpublish ]

<i>When in doubt, clear the cache.</i>

steve walker

Tuesday 03 August 2004 2:16:21 am

Hi!

It seems I'm back on this problem again... didnt manage to solve it last time, but found a work around - this time it seems I have to solve it :(

I'm suprised noone else has come across this - having a menu that expands to show the available sub-options without sending you to the clicked on page are common - but I guess normally use javascript.

To answer Alex's question, I'm not using javascript.

The problem is that the menu expands dependent on the nodeid of the page, but if you remove the link in the 1st level of the menu the nodeid doesnt change and so the menu doesnt expand.

So its a coding catch22.

Has anyone had to deal with a similar situation... to explain what I'm trying to do. I have a client who has 350 or so product catagories. They want a tree menu that expands, or some other form of sensible navigation. So you might choose:

Cheese >> Blue Cheeses >> Stilton

The problem is I dont want to be redirected to the index pages of 'Cheese' and 'Blue Cheese' as I expand the menu to get to 'Stilton' - its only when I click on 'Stilton' should there be any form of navigational direct.

Any thoughts or work arounds for this, especially ones that dont include java as they want the site to be as search engine friendly as possible.

Thanks, Steve.

http://www.oneworldmarket.co.uk

Kevin Myles

Tuesday 03 August 2004 8:02:52 am

Nevermind :>

Alex Jones

Tuesday 03 August 2004 9:25:19 am

Steve, one solution (less than ideal), would be to add a checkbox to the class used for your categories to toggle whether or not a link should be provided. You could then check the value of the checkbox in your code to decide whether or not you provide the link. So, in your case if Cheese and Blue Cheese were not checked, but Stilton is, your code would display the link for the Stilton page.

If there are a set number of levels, you could try detecting the current depth of the item being displayed in the menu and decide that any menu item greater than X deep would display the link. But that would require a rigid category structure which may not be realistic.

One thought in general, using JavaScript in this case shouldn't make the site any less friendly to search engines as they will merely ignore the JavaScript command to stop the load and visit the page, which conveniently will have a bunch of your keywords on it. In ranking the pages though, Google and its competitors are unlikely to offer the user these intermediary pages, as other pages on your site are likely to have the same keywords plus additional content. On our corporate site we make extensive use of menus which have links to category pages much like your own and haven't had any issues with page ranking.

Alex
bald_technologist on the IRC channel: #eZpublish
http://www.agrussell.com :: http://www.cuttingedge.com

Alex
[ bald_technologist on the IRC channel (irc.freenode.net): #eZpublish ]

<i>When in doubt, clear the cache.</i>

steve walker

Tuesday 03 August 2004 12:39:36 pm

Alex,

Just a thought on how this could work, though its beyond my coding level...

The issue with current nav is that the node of the currently loaded page creates the point in which the treemenu builds itself from.

Is there a way of storing the clicked on (level1) links nodeid without navigating to its page - and when the page reloads using this stored variable to build the treenav rather than the current page nodeid.

This could be non-java script solution...?

Steve.

http://www.oneworldmarket.co.uk

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu