Adding tabs to the user's tabs using views2

bob_hirnlego - June 13, 2008 - 09:53

Hi.

I wanted to add view pages as tabs to the user's tab menu, something like:

_| view | edit | latest content |_

"latest content" should point to "users//latest".

I set up my view page path to "users/%/latest" and the tab setting is
"menu tab". Argument of the view is "User: Name".

Problem is that no "latest content" tab is showing up when on "user/" and not "view" or "edit" tab is showing up when on "user//latest", while the page is working correctly.

What I'm missing here?

Thanks.
b.

Hi Bob, Try using

Liliplanet - June 13, 2008 - 10:35

Hi Bob,

Try using user/$arg/latest as the page path and select 'make default menu tab'.

Hope this helps ...

Thanks for the

bob_hirnlego - June 13, 2008 - 13:04

Thanks for the answer.
Views2 doesn't support '$arg' anymore, they replaced it with '%'... anyway, I tried 'default menu tab' but that doesn't work too.

bob

I see my post is all scrumbled up...

bob_hirnlego - June 13, 2008 - 13:08

... this is how it should have been:

I wanted to add view pages as tabs to the user's tab menu, something like:

_| view | edit | latest content |_

"latest content" should point to "users/username/latest".

I set up my view page path to "users/%/latest" and the tab setting is
"menu tab". Argument of the view is "User: Name".

Problem is that no "latest content" tab is showing up when on "users/username" and not "view" or "edit" tab is showing up when on "users/username/latest", while the page is working correctly.

Sorry.

b.

Can anybody shed some light

bob_hirnlego - June 18, 2008 - 15:39

Can anybody shed some light on this?

Thanks!
b.

Anyone? b.

bob_hirnlego - June 23, 2008 - 08:58

Anyone?

b.

Same problem

korvus - November 6, 2008 - 22:51

I've run into the exact same problem, if someone has an answer for it. Running Drupal 6.6 with Views 6.x-2.1.

In particular, I have a view that shows a user's latest comments when you go to users/username/comments. But I can't get it to show up as a tab from users/username. Is this possible, or do I need to write a module to hook into the menu system correctly? It would seem to be what the Type: Menu Tab option is for, though I suppose it's possible that doesn't work with existing tabs (only sets of tabs created by Views)?

FYI, if I export my view, here's the relevant part where I try to attach it as a tab to users/%/:

<?php
$handler
= $view->new_display('page', 'Page', 'page_1');
$handler->override_option('path', 'users/%/comments');
$handler->override_option('menu', array(
 
'type' => 'tab',
 
'title' => 'Comments',
 
'weight' => '15',
 
'name' => 'navigation',
));
$handler->override_option('tab_options', array(
 
'type' => 'none',
 
'title' => '',
 
'weight' => 0,
));
?>

Solved?

svogel - April 29, 2009 - 19:48

I've tried it with Drupal 6.10 and Views 6.x-2.3 and it works like a charm.
Remember that the default user-path (for user-profile) is "/user" not "/users".

Best regards
Stefan

 
 

Drupal is a registered trademark of Dries Buytaert.