I've seen: http://drupal.org/node/648462 ; but it doesn't appear to account for terms from a context.

My use case is as follows:
I have products (content-type: product) tagged with terms in a catalog (my vocabulary).
I also have accessories (content-type: accessory) tagged with the terms from the same catalog.

I want to display the accessories on the product's page (via a Panel) that are tagged with similar terms (generally a term at the root of the catalog).

$view = new view;
$view->name = 'catalog';
$view->description = 'List of products.';
$view->tag = '';
$view->view_php = '';
$view->base_table = 'node';
$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 = $view->new_display('panel_pane', 'Accessories', 'panel_pane_2');
$handler->override_option('arguments', array(
  'term_node_tid_depth' => array(
    'default_action' => 'empty',
    'style_plugin' => 'default_summary',
    'style_options' => array(),
    'wildcard' => 'all',
    'wildcard_substitution' => 'All',
    'title' => '',
    'breadcrumb' => '',
    'default_argument_type' => 'taxonomy_tid',
    'default_argument' => '',
    'validate_type' => 'taxonomy_term',
    'validate_fail' => 'empty',
    'depth' => '-2',
    'break_phrase' => 1,
    'set_breadcrumb' => 0,
    'use_taxonomy_term_path' => 0,
    'id' => 'term_node_tid_depth',
    'table' => 'node',
    'field' => 'term_node_tid_depth',
    'validate_user_argument_type' => 'uid',
    'validate_user_roles' => array(
      '2' => 0,
      '6' => 0,
      '4' => 0,
      '7' => 0,
      '5' => 0,
      '9' => 0,
      '3' => 0,
      '8' => 0,
    ),
    'override' => array(
      'button' => 'Use default',
    ),
    'relationship' => 'none',
    'default_options_div_prefix' => '',
    'default_argument_image_size' => '_original',
    'default_argument_fixed' => '',
    'default_argument_user' => 0,
    'default_argument_php' => '',
    'image_size' => array(
      '_original' => '_original',
      'thumbnail' => 'thumbnail',
      'preview' => 'preview',
    ),
    'validate_argument_node_type' => array(
      'webform' => 0,
      'image' => 0,
      'product' => 0,
      'course' => 0,
      'accessory' => 0,
      'panel' => 0,
      'book' => 0,
      'company' => 0,
      'document' => 0,
      'event' => 0,
      'page' => 0,
      'review_company' => 0,
      'review_product' => 0,
      'story' => 0,
    ),
    'validate_argument_node_access' => 0,
    'validate_argument_nid_type' => 'nid',
    'validate_argument_vocabulary' => array(
      '6' => 6,
      '4' => 0,
      '10' => 0,
      '8' => 0,
      '3' => 0,
      '9' => 0,
      '1' => 0,
      '7' => 0,
      '12' => 0,
      '13' => 0,
      '11' => 0,
      '14' => 0,
      '15' => 0,
    ),
    'validate_argument_type' => 'convert',
    'validate_argument_transform' => 0,
    'validate_user_restrict_roles' => 0,
    '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' => 'node',
    'field' => 'status',
    'relationship' => 'vid',
    'override' => array(
      'button' => 'Use default',
    ),
  ),
  'is_product' => array(
    'operator' => '=',
    'value' => '1',
    'group' => '0',
    'exposed' => FALSE,
    'expose' => array(
      'operator' => FALSE,
      'label' => '',
    ),
    'id' => 'is_product',
    'table' => 'uc_products',
    'field' => 'is_product',
    'relationship' => 'vid',
    'override' => array(
      'button' => 'Use default',
    ),
  ),
  'type' => array(
    'operator' => 'in',
    'value' => array(
      'accessory' => 'accessory',
    ),
    'group' => '0',
    'exposed' => FALSE,
    'expose' => array(
      'operator' => FALSE,
      'label' => '',
    ),
    'id' => 'type',
    'table' => 'node',
    'field' => 'type',
    'override' => array(
      'button' => 'Use default',
    ),
    'relationship' => 'none',
  ),
));
$handler->override_option('empty', 'Sorry; we couldn\'t locate any accessories for this product.');
$handler->override_option('empty_format', '1');
$handler->override_option('style_plugin', 'grid');
$handler->override_option('style_options', array(
  'grouping' => '',
  'columns' => '2',
  'alignment' => 'horizontal',
  'fill_single_line' => 1,
));
$handler->override_option('row_plugin', 'ds_fields');
$handler->override_option('row_options', array(
  'title' => array(
    'region' => 'middle',
    'weight' => '-49',
    'css-class' => array(),
    'labelformat' => 'hidden',
  ),
  'sell_price' => array(
    'region' => 'right',
    'weight' => '-48',
    'css-class' => array(),
    'labelformat' => 'hidden',
  ),
  'buyitnowbutton' => array(
    'region' => 'footer',
    'weight' => '-47',
    'css-class' => array(),
    'labelformat' => 'hidden',
  ),
  'field_image_cache_fid' => array(
    'region' => 'middle',
    'weight' => '-50',
    'css-class' => array(),
    'labelformat' => 'hidden',
  ),
  'buttons' => array(
    'submit' => 'Update',
    'cancel' => 'Cancel',
  ),
  'regions' => array(
    'middle' => array(
      'title' => '-49',
      'field_image_cache_fid' => '-50',
    ),
    'right' => array(
      'sell_price' => '-48',
    ),
    'footer' => array(
      'buyitnowbutton' => '-47',
    ),
  ),
  'module' => 'nd',
  'object_type' => 'node',
));
$handler->override_option('pane_title', 'Related Accessories');
$handler->override_option('pane_description', 'Displays product accessories.');
$handler->override_option('pane_category', array(
  'name' => 'Products',
  'weight' => '0',
));
$handler->override_option('allow', array(
  'use_pager' => 'use_pager',
  'items_per_page' => 'items_per_page',
  'offset' => 'offset',
  'link_to_view' => 'link_to_view',
  'more_link' => 'more_link',
  'path_override' => 'path_override',
  'title_override' => 'title_override',
  'exposed_form' => 'exposed_form',
  'fields_override' => 'fields_override',
));
$handler->override_option('argument_input', array(
  'term_node_tid_depth' => array(
    'type' => 'context',
    'context' => 'terms.names',
    'context_optional' => 0,
    'panel' => '0',
    'fixed' => '',
    'label' => 'Taxonomy: Term ID (with depth)',
  ),
));
$handler->override_option('link_to_view', 0);
$handler->override_option('inherit_panels_path', '1');

Comments

wjaspers’s picture

Project: Views (for Drupal 7) » Quick Tabs
Version: 6.x-2.11 » 6.x-2.0-rc5
Component: taxonomy data » Code
Category: support » feature
Issue tags: +contexts

FIgured it out; but it turns out QuickTabs can't access the context I need (%terms:tids) or (%terms:names).
Oddly enough, it CAN see (%node:nid).

Will QuickTabs support access to contexts in Panels?
Is there a way QT's can permit arguments to be passed from Panels to the QT block(s)?

wjaspers’s picture

Title: Proper way to Display related nodes by taxonomy terms in a context » Allow context arguments to be passed to tabs
efreedom’s picture

So I'm not clear on what QuickTabs supports regarding arguments.

I'm create a two Tab Page. The first tab is simply a node
http://foo.com/mystuff/john
http://foo.com/mystuff/harry
http://foo.com/mystuff/jane

And then a view that allows arguments
http://foo.com/myview/john
http://foo.com/myview/harry
http://foo.com/myview/jane

Passing an argument to the view seems to be ok but how do I get "mystuff" to accept an argument that includes the name. Does anyone have a visual example of setting up a quicktab page and applying arguments in this fashion?

Bob

wjaspers’s picture

Not to poke at you; but I moved this into the QT issue queue because it evolved into a feature request. I'm asking QTs to be made compatible with Panels (probably a far reaching request).

But, to make this work, setup your view(s) to accept an argument, whether it be string, taxonomy term, node nid or whatever.
To pass the argument from the page to the QuickTab, on the quicktab block settings, send %1 (according to your url layout, "myview" would be %0, and "john|harry|jane" would be %1.

netw3rker’s picture

Status: Active » Closed (fixed)

panels support is handled in the 7.x-3.x line.