Hi all, I have a view that return all user content and I want to link this page, in a menu entry, with the url user/UID/mycontent. My view works, I need to specify a parameter in the menu entry.
How can I do this ?
Thanks,
M.
Le jeudi 22 juillet 2010 à 15:36 +0200, Michel Morelli a écrit :
Hi all, I have a view that return all user content and I want to link this page, in a menu entry, with the url user/UID/mycontent. My view works, I need to specify a parameter in the menu entry.
How can I do this ?
Thanks,
M.
If you are using views, you can specify a path for you view (display page). In this path, specify % in place of the uid, you will get this path:
user/%/mycontent
Then, add an argument to your view, which is the node create uid, specify in the argument configuration the user must exists, and that the view require this relationship. Specify it waits for a numeric uid.
Then, finish by configuring, in the path settings, that the % correspond to your argument (I can't remember if views does it by itself or not).
Pierre.
Hi all, there was a misunderstanding. I know how to create a view (I'm develop social network site with drupal). My question is: how I can define a primary-menu (or secondary or mymenu) entry that is dynamic. I want to use the normal drupal way to create menu and menu-entry (/admin/build/menu) per create this dinamyc entry. I have found that /user/%/mypath (link to a view) is transformed in /user/THE_UID_OF_LOGGED_USER/mypath.
M.
Le jeudi 22 juillet 2010 à 21:43 +0200, Michel Morelli a écrit :
Hi all, there was a misunderstanding. I know how to create a view (I'm develop social network site with drupal). My question is: how I can define a primary-menu (or secondary or mymenu) entry that is dynamic. I want to use the normal drupal way to create menu and menu-entry (/admin/build/menu) per create this dinamyc entry. I have found that /user/%/mypath (link to a view) is transformed in /user/THE_UID_OF_LOGGED_USER/mypath.
M.
Hum, I have some troubles trying to understand you. What exactly do you want to display when users click on your menu entry, and where do you want this menu entry to be in your menu ?
Pierre.
Michel Morelli ha scritto:
Hi all, I have a view that return all user content and I want to link this page, in a menu entry, with the url user/UID/mycontent. My view works, I need to specify a parameter in the menu entry.
How can I do this ?
Very very simple: in menu entry for the path entry write "user/%/mycontent". Et voilà. User 1 will see "user/1/mycontent", User with uid 6 will see "user/6/mycontent".
Someone know other things like this ??? :D
M.
Michel Morelli ha scritto:
Very very simple: in menu entry for the path entry write "user/%/mycontent". Et voilà. User 1 will see "user/1/mycontent", User with uid 6 will see "user/6/mycontent".
Only 1 thing: I have insert "user/%/mycontent" in the standard drupal form menu entry ( "admin/build/menu-customize/menu-nuovo-contenuto/add" ), not in my hook_menu() function.
M.