I have successfully created a page view that places a tab on the main user profile page (at user/uid). To create the tab, I set the path and menu as follows:
Path: user/%/amigos
Menu: Type = "Menu tab", Title = "Amigos"
So when I navigate for example to user/10, I see the users main profile page with the following tab structure:
View|Amigos|Edit|Track etc.
If I click on the "Amigos" tab, I am taken to (for example) user/10/amigos, where I see that the contents of the view show correctly.
The PROBLEM is that once I'm one the page with the view, all the tabs have disappeared, and the page title as well. What I would expect is for the title and tabs to remain in place, providing a seamless user profile navigation experience.
You can see the export of my view below in case it is a configuration problem. If it is not a configuration problem, could someone tell me whether this is a bug or if it is working as designed? Any help in getting the other pre-existing tabs to remain in place while viewing the tab provided by my view would be greatly appreciated.
thanks!
$view = new view;
$view->name = 'Amigos_x_perfil';
$view->description = 'Ver todos los amigos del miembro cuyo perfil se está viendo';
$view->tag = '';
$view->view_php = '';
$view->base_table = 'user_relationships';
$view->is_cacheable = FALSE;
$view->api_version = 2;
$view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */
$handler = $view->new_display('default', 'Defaults', 'default');
$handler->override_option('relationships', array(
'requestee_id' => array(
'id' => 'requestee_id',
'table' => 'user_relationships',
'field' => 'requestee_id',
),
));
$handler->override_option('fields', array(
'picture' => array(
'label' => '',
'alter' => array(
'alter_text' => 0,
'text' => '',
'make_link' => 0,
'path' => '',
'link_class' => '',
'alt' => '',
'prefix' => '',
'suffix' => '',
'help' => '',
'trim' => 0,
'max_length' => '',
'word_boundary' => 1,
'ellipsis' => 1,
'strip_tags' => 0,
'html' => 0,
),
'exclude' => 0,
'id' => 'picture',
'table' => 'users',
'field' => 'picture',
'relationship' => 'requestee_id',
),
'name' => array(
'label' => '',
'alter' => array(
'alter_text' => 0,
'text' => '',
'make_link' => 0,
'path' => '',
'link_class' => '',
'alt' => '',
'prefix' => '',
'suffix' => '',
'help' => '',
'trim' => 1,
'max_length' => '6',
'word_boundary' => 0,
'ellipsis' => 1,
'strip_tags' => 0,
'html' => 0,
),
'link_to_user' => 0,
'overwrite_anonymous' => 0,
'anonymous_text' => '',
'exclude' => 0,
'id' => 'name',
'table' => 'users',
'field' => 'name',
'relationship' => 'requestee_id',
),
));
$handler->override_option('arguments', array(
'requester_id' => array(
'default_action' => 'not found',
'style_plugin' => 'default_summary',
'style_options' => array(),
'wildcard' => '',
'wildcard_substitution' => '',
'title' => '',
'breadcrumb' => '',
'default_argument_type' => 'fixed',
'default_argument' => '',
'validate_type' => 'numeric',
'validate_fail' => 'not found',
'break_phrase' => 0,
'not' => 0,
'id' => 'requester_id',
'table' => 'user_relationships',
'field' => 'requester_id',
'validate_user_argument_type' => 'uid',
'validate_user_roles' => array(
'2' => 0,
'3' => 0,
'5' => 0,
'4' => 0,
),
'override' => array(
'button' => 'Override',
),
'relationship' => 'none',
'default_options_div_prefix' => '',
'default_argument_user' => 0,
'default_argument_fixed' => '',
'validate_argument_node_type' => array(
'blog' => 0,
'poll' => 0,
'image' => 0,
'forum' => 0,
'book' => 0,
'centro_edu' => 0,
'chat' => 0,
'estudios' => 0,
'page' => 0,
'perfiles_profesionales' => 0,
'profile' => 0,
'story' => 0,
'yaq_breve' => 0,
),
'validate_argument_node_access' => 0,
'validate_argument_nid_type' => 'nid',
'validate_argument_vocabulary' => array(
'8' => 0,
'3' => 0,
'7' => 0,
'9' => 0,
'11' => 0,
'5' => 0,
'10' => 0,
'12' => 0,
'1' => 0,
'6' => 0,
'4' => 0,
),
'validate_argument_type' => 'tid',
'validate_argument_transform' => 0,
'validate_user_restrict_roles' => 0,
'validate_argument_node_flag_name' => '*relationship*',
'validate_argument_node_flag_test' => 'flaggable',
'validate_argument_node_flag_id_type' => 'id',
'validate_argument_user_flag_name' => '*relationship*',
'validate_argument_user_flag_test' => 'flaggable',
'validate_argument_user_flag_id_type' => 'id',
'image_size' => array(
'_original' => '_original',
'thumbnail' => 'thumbnail',
'preview' => 'preview',
'tiny' => 'tiny',
),
'default_argument_php' => '',
'validate_argument_php' => '',
),
));
$handler->override_option('filters', array(
'status' => array(
'operator' => '=',
'value' => '1',
'group' => '0',
'exposed' => FALSE,
'expose' => array(
'operator' => FALSE,
'label' => '',
),
'id' => 'status',
'table' => 'users',
'field' => 'status',
'relationship' => 'requestee_id',
'override' => array(
'button' => 'Override',
),
),
'rtype' => array(
'operator' => 'in',
'value' => array(
'0' => '1',
),
'group' => '0',
'exposed' => FALSE,
'expose' => array(
'operator' => FALSE,
'label' => '',
),
'id' => 'rtype',
'table' => 'user_relationships',
'field' => 'rtype',
'override' => array(
'button' => 'Override',
),
'relationship' => 'none',
),
));
$handler->override_option('access', array(
'type' => 'none',
));
$handler->override_option('cache', array(
'type' => 'none',
));
$handler->override_option('empty', 'Este usuario todavía no ha añadido ningún amigo');
$handler->override_option('empty_format', '4');
$handler->override_option('items_per_page', 30);
$handler->override_option('use_pager', '1');
$handler = $view->new_display('page', 'Página', 'page_1');
$handler->override_option('path', 'user/%/amigos');
$handler->override_option('menu', array(
'type' => 'tab',
'title' => 'Amigos',
'description' => 'Ver los amigos de este miembro',
'weight' => '0',
'name' => 'navigation',
));
$handler->override_option('tab_options', array(
'type' => 'none',
'title' => '',
'description' => '',
'weight' => '0',
));
$handler = $view->new_display('block', 'Bloque', 'block_1');
$handler->override_option('block_description', '');
$handler->override_option('block_caching', -1);
Comments
Comment #1
sja1 commentedUPDATE: This has very strangely fixed itself. I'll describe what I was doing when it got fixed, in case this helps somebody else.
On my site I have user/uid aliased to the users nickname. So, if I user registers with nick chuck88, you can view his user profile at www.oursiteurl.com/chuck88. (I know, it would have been better to alias it to "user/chuck88" and not just "chuck88", but I didn't know that back when we created the site).
Let's say chuck88 is really user/19.
Guessing at possible causes, I thought maybe the problem was with the aliases. So I deleted the path alias corresponding to user/19, and, navigated to user/19, clicked on the "amigos" tab provided by my view, and.... the tabs problem I described above had gone away!
So next I created a new alias for user/19 as "user/chuck88", to see if the problem was caused by the old alias having just one term. Navigating to "user/chuck88", I saw that the problem had not come back. The tabs were still working properly.
Finally, just to be sure, I deleted the "user/chuck88" alias, and recreated the original "chuck88" alias, expecting the problem to come back. But it didn´t! Next I navigated to a user alias that I hadn't touched, call it "bob99". Well, the amigos tab on "bob99" and all other user aliases are now strangely working. The problem with the tabs disappearing once I clicked on the tab taking me to my page view is no longer a problem.
I hate when that happens! But glad it did.
If the problem reappears I will report back here.
Comment #3
k_and_j commentedUPDATE: fixed - I added %1 to the Title field for the settings of the Argument (Content: Gallery, in this case). Breadcrumb and dynamic title now appear.
I think I have something similar happening. I am using Views Gallery and Draggable Views (which I think is irrelevant, but jic). I added a new Page to the gallery view so that I could have an option for users to rearrange their images in their gallery. The new Page uses Style: Draggable Views (again, I think this is irrelevant).
I did not change the Title (it uses Default Display value of "None")
I set path to: node/%/sort
Menu is Tab: Rearrange
When I navigate to a photo gallery, I see (from top to bottom) a breadcrumb, then the title of the gallery, then the tabs, then the content of the gallery. When I click on the Rearrange tab, the breadcrumb and gallery title disappear.
If I change the Title in my new View to anything, the breadcrumb reappears and the text of the title I entered is there. That's fine as far as it goes, but I want the dynamic title of the actual gallery to appear as it does on the View and Edit pages. Any idea how I get this to work?