Hi!

I have a views page that reads an argument from the url.

e.g. http://www.mydomain.com/myviewspage/4

I put the argument into the menue link path. So I can have one view and create a menue item that alters the view result. But when I do this the menue gets no active trail any more.

eg. Menue path = /myviewspage -> active path is set -> the complete view is shown
Menue path = /myviewspage/4 -> active path is gone -> the view works like expected

Is this a bug or can this just not be done by design of the menue system?

Regards
Marcus

Comments

mordonez’s picture

I've the same problem

hansrossel’s picture

Project: Drupal core » Views (for Drupal 7)
Version: 7.0 » 7.x-3.0-alpha1
Component: menu system » Miscellaneous
Priority: Major » Normal

Better ask this in the views issue queue

merlinofchaos’s picture

Project: Views (for Drupal 7) » Drupal core
Version: 7.x-3.0-alpha1 » 7.0
Component: Miscellaneous » menu system

Core should be handling the active trail here. This may be a bug in the menu system. Moving back to core queue.

kip stanning’s picture

active trail issue also applies to drupal 6. i am using acquia marina in d6. unfortunately drupal stops reading the active trail at the first forward slash after the base url.

subscribe

karl

kla2t’s picture

subscribe

marcusx’s picture

I didn't use a placeholder "%" in my path because my view was working also without it, because I only had one argument at the end of the URL. After putting the % at the end of the path it seems to be working. Can someone confirm this?

rjacobs’s picture

Yes, adding the % in the path settings for the view fixes this for me. I'm guessing that views will default to placing arguments immediately after the entered path, in order, if no argument placement is specified (e.g. it'll treat a path of just "myview" like "myview/%" if one argument is passed). However, it seems that the menu system is only aware that any views arguments should be considered when calculating the active item if those arguments are explicitly defined with a "%" in the view path. All of that is a bit of "under the hood" speculation, but this is what a bit of trial-and-error seems to show.

alan_brown’s picture

I am in the Similar problem I have attached a Page to a View I want it to take the of Active Menu Item Class, I am using Drupal 7 I am trying this since long time not getting any solution Can some1 tell exactly how it can be possible.

alan_brown’s picture

Found out just make a menu item and keep it disabled .

dadderley’s picture

This is a good find, I am glad that I found this discussion.
My Drupal version is 7.8
I have a similar issue.
When not putting the argument % at the end of the url, the Drupal menu module does not treat menu links (with the view path + the argument) as a real menu item.
If this menu item (with the view path + the argument) was nested in a menu, it does not keep the menu open when the link was clicked.
Putting the % placeholder at the end of the view path makes the menu system aware and solves the problem.

damiankloip’s picture

So this is sorted then? wouldn't you always put a placeholder in the views path if you wanted it to have an arg from the url regardless of whether it changes or not.

merlinofchaos’s picture

Not at the end of a path.

my/path/% is different from my/path but both are valid parents of 'my/path/foo/bar'

damiankloip’s picture

I see your point :) it should know its parent....

Version: 7.0 » 7.x-dev

Core issues are now filed against the dev versions where changes will be made. Document the specific release you are using in your issue comment. More information about choosing a version.

Status: Active » Closed (outdated)

Automatically closed because Drupal 7 security and bugfix support has ended as of 5 January 2025. If the issue verifiably applies to later versions, please reopen with details and update the version.