I'm stumped-- I've got a page view setup at user/$arg/pages that displays the authored pages of the user currently being viewed. I've checked "provide menu" and "provide menu as tab"-- tab menu works fine.

I'm trying to also manually create a menu item to that page for inclusion into a custom "my account" menu but nothing I try works. I've tried the 'me' alias module, simply entering user/$arg/pages into the menu item-- all sorts of things but I simply can't get this work.

How does one manually create a menu item for a view with arguments? I know it must be something stupid simple-- what am I missing?

Comments

alanburke’s picture

See http://groups.drupal.org/node/8386
for one possible solution

alanburke’s picture

Priority: Normal » Minor
Status: Active » Postponed (maintainer needs more info)
WorldFallz’s picture

Thanks for the link-- I read through the post, but I'm not sure how it might help. I'm not trying to create a tab on a node (i've got that working fine with standard views menu as tab option). All I want to do now, is add an additional menu item to a custom menu i have (admin/build/menu) pointing to that same view. When i simply type it in the url textbox for the menu item it doesnt work (it has an argument-- user/$arg/pages). So what I really need to know is how to create manually create a menu item (at admin/build/menu) for a view with an argument.

does that make more sense?

merlinofchaos’s picture

The problem is that you need to supply an argument, and menu items don't have a concept of that. So the only way to do it that I can think of is to create a different menu item that figures out what the argument should be and performs a redirect.

WorldFallz’s picture

thanks for replying earl, and pointing me in the right direction. I just wasn't sure if I was missing something stupid easy. at least now i know i'm not wasting my time... thanks again.

moshe weitzman’s picture

If you use hook_menu_link_alter() in a custom module, you can dynamically enter an argument based on the currently logged in user. Use http://api.drupal.org/api/function/hook_menu_link_alter/6 and note how it is used to append a dynamic querystring in the item for devel/cache/clear, for example.

This is very advanced menu functionality, and quite handy.

moshe weitzman’s picture

oops - my suggestion is for d6

wundo’s picture

Priority: Minor » Normal

subscribing

sun’s picture

Version: 5.x-1.6 » 6.x-2.x-dev
Component: page displays » Code
Category: support » feature
Status: Postponed (maintainer needs more info) » Active

If at all, this would be a feature request for 6.x. Having the benefit of dynamic arguments through the new menu system, this might work out somehow.

On D5, the only workaround is to define a custom menu item in a custom module, which passes any additional arguments on to your view.

merlinofchaos’s picture

Status: Active » Closed (duplicate)

There are other issues asking for this same feature.

fabiannavarro’s picture

As I can create a menu based on arguments of views? For Drupal 6.
Thanks for any response ;-) 8-----,

claar’s picture

@#10: It would have been helpful to link a few of them then. This one has the highest Google page-rank (for my search "menu_item view argument"), and I'm having trouble finding whatever issues you were referring to.

digitalfrontiersmedia’s picture

Yes, agreed. If closing as a duplicate, you obviously know where the duplicate is and should direct the thread in that direction rather than creating a dead-end and causing others to perform needless additional searching.