Closed (duplicate)
Project:
Views (for Drupal 7)
Version:
6.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
2 Jul 2008 at 20:49 UTC
Updated:
22 May 2011 at 20:21 UTC
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
Comment #1
alanburke commentedSee http://groups.drupal.org/node/8386
for one possible solution
Comment #2
alanburke commentedComment #3
WorldFallz commentedThanks 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?
Comment #4
merlinofchaos commentedThe 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.
Comment #5
WorldFallz commentedthanks 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.
Comment #6
moshe weitzman commentedIf 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.
Comment #7
moshe weitzman commentedoops - my suggestion is for d6
Comment #8
wundo commentedsubscribing
Comment #9
sunIf 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.
Comment #10
merlinofchaos commentedThere are other issues asking for this same feature.
Comment #11
fabiannavarro commentedAs I can create a menu based on arguments of views? For Drupal 6.
Thanks for any response ;-) 8-----,
Comment #12
claar commented@#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.
Comment #13
digitalfrontiersmediaYes, 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.