Skip to content

Instantly share code, notes, and snippets.

@barraponto
Created November 5, 2012 12:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save barraponto/4016927 to your computer and use it in GitHub Desktop.
Save barraponto/4016927 to your computer and use it in GitHub Desktop.
Views 6.x-2.x Related terms view
$view = new view;
$view->name = 'related_terms';
$view->description = 'related terms';
$view->tag = '';
$view->base_table = 'term_data';
$view->core = 6;
$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(
'tid2' => array(
'label' => 'Related term',
'required' => 0,
'id' => 'tid2',
'table' => 'term_relation',
'field' => 'tid2',
'relationship' => 'none',
),
));
$handler->override_option('fields', array(
'name' => array(
'label' => 'Term',
'alter' => array(
'alter_text' => 0,
'text' => '',
'make_link' => 0,
'path' => '',
'absolute' => 0,
'link_class' => '',
'alt' => '',
'rel' => '',
'prefix' => '',
'suffix' => '',
'target' => '',
'help' => '',
'trim' => 0,
'max_length' => '',
'word_boundary' => 1,
'ellipsis' => 1,
'html' => 0,
'strip_tags' => 0,
),
'empty' => '',
'hide_empty' => 0,
'empty_zero' => 0,
'hide_alter_empty' => 1,
'link_to_taxonomy' => 1,
'exclude' => 0,
'id' => 'name',
'table' => 'term_data',
'field' => 'name',
'relationship' => 'tid2',
),
));
$handler->override_option('arguments', array(
'tid' => array(
'default_action' => 'default',
'style_plugin' => 'default_summary',
'style_options' => array(),
'wildcard' => 'all',
'wildcard_substitution' => 'All',
'title' => '',
'breadcrumb' => '',
'default_argument_type' => 'taxonomy_tid',
'default_argument' => '',
'validate_type' => 'none',
'validate_fail' => 'not found',
'break_phrase' => 0,
'not' => 0,
'id' => 'tid',
'table' => 'term_data',
'field' => 'tid',
'validate_user_argument_type' => 'uid',
'validate_user_roles' => array(
2 => 0,
),
'relationship' => 'none',
'default_options_div_prefix' => '',
'default_taxonomy_tid_term_page' => 1,
'default_taxonomy_tid_node' => 0,
'default_taxonomy_tid_limit' => 0,
'default_taxonomy_tid_vids' => array(
1 => 0,
),
'default_argument_user' => 0,
'default_argument_fixed' => '',
'default_argument_php' => '',
'validate_argument_node_type' => array(
'page' => 0,
'story' => 0,
),
'validate_argument_node_access' => 0,
'validate_argument_nid_type' => 'nid',
'validate_argument_vocabulary' => array(
1 => 0,
),
'validate_argument_type' => 'tid',
'validate_argument_transform' => 0,
'validate_user_restrict_roles' => 0,
'validate_argument_php' => '',
),
));
$handler->override_option('access', array(
'type' => 'none',
));
$handler->override_option('cache', array(
'type' => 'none',
));
$handler = $view->new_display('block', 'Block', 'block_1');
$handler->override_option('block_description', '');
$handler->override_option('block_caching', -1);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment