There seems to be an issue when working with multiple vocabularies.
I am trying to setup a view that will need both arguments to be from different vocabularies and having some trouble.
I have a list of countries and a list of topics, so I would want something like this:
page/Argentina/25
This actually seems to work because I can see it pull the title properly, however it is not grabbing any of the 2nd parameter nodes as if no nodes have that category selected.
The strange thing is when I display the TermID field for each node, it lists the ID of the first parameter ONLY. The query given is:
SELECT node.nid AS nid,
node.title AS node_title,
node.language AS node_language,
node.vid AS node_vid
FROM d6_node node
LEFT JOIN d6_term_node term_node ON node.vid = term_node.vid
INNER JOIN d6_term_data term_data ON term_node.tid = term_data.tid
WHERE (node.type in ('listings')) AND (term_data.name = 'Argentina') AND (term_node.tid = 25)
| Comment | File | Size | Author |
|---|---|---|---|
| #7 | n.jpg | 47.65 KB | iamjon |
| #6 | termid termid.jpg | 57.92 KB | iamjon |
| #3 | argument1.jpg | 77.29 KB | iamjon |
| #3 | argument2.jpg | 78.74 KB | iamjon |
| #3 | export.txt | 5.63 KB | iamjon |
Comments
Comment #1
iamjon commentedkilrizzy,
Can you please provide step by step instructions of what you have and an export of your view using simple fields and common content types if your setup depends on a complicated structure please create a feature or provide a cck export as well.
Comment #2
kilrizzy commentedThe content type is just called 'listings' which contains basic title/body fields along with the ability to choose terms from 2 vocabularies (topic and country).
I currently just have the view displaying the title and "all terms" from each node.
It works when there are no arguments ("/country") (set to list all). Then I see all listed nodes. It still works when I add my first argument "country/Argentina"
When I add the last argument (which is just the id for the term from the 'listing topic' vocab), nothing is displayed ("country/Argentina/25"). However, the title does show up correctly so I know the term was found:
"Argentina - Constitution"
When I show the field "Taxonomy - Term ID" for each node it only lists the single term id of the first term. Which I think would be the problem because it can't find a node with a term id of "25" since it only has a term id of "1" (from the first vocab)
---The view:---
$view = new view;
$view->name = 'country';
$view->description = 'Country Page';
$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->override_option('fields', array(
'title' => array(
'label' => 'Title',
'alter' => array(
'alter_text' => 0,
'text' => '',
'make_link' => 0,
'path' => '',
'link_class' => '',
'alt' => '',
'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,
'link_to_node' => 0,
'exclude' => 0,
'id' => 'title',
'table' => 'node',
'field' => 'title',
'relationship' => 'none',
),
'tid_1' => array(
'label' => 'All terms',
'alter' => array(
'alter_text' => 0,
'text' => '',
'make_link' => 0,
'path' => '',
'link_class' => '',
'alt' => '',
'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,
'type' => 'separator',
'separator' => ', ',
'link_to_taxonomy' => 1,
'limit' => 0,
'vids' => array(
'1' => 0,
'2' => 0,
),
'exclude' => 0,
'id' => 'tid_1',
'table' => 'term_node',
'field' => 'tid',
'relationship' => 'none',
),
));
$handler->override_option('arguments', array(
'name' => array(
'default_action' => 'ignore',
'style_plugin' => 'default_summary',
'style_options' => array(),
'wildcard' => 'all',
'wildcard_substitution' => 'All',
'title' => '%1',
'breadcrumb' => '',
'default_argument_type' => 'fixed',
'default_argument' => '',
'validate_type' => 'taxonomy_term',
'validate_fail' => 'not found',
'glossary' => 0,
'limit' => '0',
'case' => 'none',
'path_case' => 'none',
'transform_dash' => 1,
'add_table' => 0,
'require_value' => 0,
'id' => 'name',
'table' => 'term_data',
'field' => 'name',
'validate_user_argument_type' => 'uid',
'validate_user_roles' => array(
'2' => 0,
'3' => 0,
),
'relationship' => 'none',
'default_options_div_prefix' => '',
'default_argument_fixed' => '',
'default_argument_user' => 0,
'default_argument_php' => '',
'validate_argument_node_type' => array(
'listings' => 0,
'page' => 0,
'story' => 0,
),
'validate_argument_node_access' => 0,
'validate_argument_nid_type' => 'nid',
'validate_argument_vocabulary' => array(
'1' => 1,
'2' => 0,
),
'validate_argument_type' => 'name',
'validate_argument_transform' => 0,
'validate_user_restrict_roles' => 0,
'validate_argument_php' => '',
),
'tid' => array(
'default_action' => 'ignore',
'style_plugin' => 'default_summary',
'style_options' => array(),
'wildcard' => 'all',
'wildcard_substitution' => 'All',
'title' => '%1 - %2',
'breadcrumb' => '',
'default_argument_type' => 'fixed',
'default_argument' => '',
'validate_type' => 'taxonomy_term',
'validate_fail' => 'ignore',
'break_phrase' => 0,
'add_table' => 0,
'require_value' => 0,
'reduce_duplicates' => 0,
'set_breadcrumb' => 0,
'id' => 'tid',
'table' => 'term_node',
'field' => 'tid',
'validate_user_argument_type' => 'uid',
'validate_user_roles' => array(
'2' => 0,
'3' => 0,
),
'relationship' => 'none',
'default_options_div_prefix' => '',
'default_argument_fixed' => '',
'default_argument_user' => 0,
'default_argument_php' => '',
'validate_argument_node_type' => array(
'listings' => 0,
'page' => 0,
'story' => 0,
),
'validate_argument_node_access' => 0,
'validate_argument_nid_type' => 'nid',
'validate_argument_vocabulary' => array(
'2' => 2,
'1' => 0,
),
'validate_argument_type' => 'tid',
'validate_argument_transform' => 0,
'validate_user_restrict_roles' => 0,
'validate_argument_php' => '',
),
));
$handler->override_option('filters', array(
'type' => array(
'operator' => 'in',
'value' => array(
'listings' => 'listings',
),
'group' => '0',
'exposed' => FALSE,
'expose' => array(
'operator' => FALSE,
'label' => '',
),
'id' => 'type',
'table' => 'node',
'field' => 'type',
'relationship' => 'none',
),
));
$handler->override_option('access', array(
'type' => 'none',
));
$handler->override_option('cache', array(
'type' => 'none',
));
$handler = $view->new_display('page', 'Page', 'page_1');
$handler->override_option('path', 'country');
$handler->override_option('menu', array(
'type' => 'none',
'title' => '',
'description' => '',
'weight' => 0,
'name' => 'navigation',
));
$handler->override_option('tab_options', array(
'type' => 'none',
'title' => '',
'description' => '',
'weight' => 0,
'name' => 'navigation',
));
Comment #3
iamjon commentedI think i got it work.
All I did was limit the first argument to country.
The second to topic.
Comment #4
iamjon commentedChanging status.
Comment #5
kilrizzy commentedI ended up doing this as well. The issue seemed to be having the second argument be Term ID. I instead used just Taxonomy Term and it works fine.
Still seems to be an issue if your second arg is looking for an id instead but in the mean time just checking for the Term name will work
Comment #6
iamjon commentedWeird
Term ID Term ID Also works
Comment #7
iamjon commentedterm id/term id/ works
term name/ term name works
term name/ term id does not
term id /term name does not
I'm not too sure if this is a bug or a feature request.
Comment #8
kartik.gmf commentedsubscribing
Comment #9
mustanggb commented