0

My Taxonomy Hierarchy:

-Council Minutes
-Reports to Council
  -Auditor
  -Treasurer
  -Tax Commissioner
-Proposed Ordinances
  -First Readings
  -Second Readings
  -Third Readings

I attached files to these terms and built a view. This view returns:

-Council Minutes
  ^File 1
  ^File 2
  ^File 3
-Auditor
  ^File 1
  ^File 2
-Treasurer
  ^File 1
  ^File 2
-Tax Commissioner
  ^File 1
  ^File 2
-First Readings
  ^File 1
-Second Readings
  ^File 1
-Third Readings
  ^File 1

As you can see the view i made took out the 2 parents, "Reports to Council" and "Proposed Ordinances". I have this view displayed as a table and it is grouped by the taxonomy term.

I want the parents to be included in this view and show the whole hierarchy. Like this:

-Council Minutes
  ^File 1
  ^File 2
  ^File 3
-Reports to Council
  -Auditor
    ^File 1
    ^File 2
  -Treasurer
    ^File 1
    ^File 2
  -Tax Commissioner
    ^File 1
    ^File 2
-Proposed Ordinances
  -First Readings
    ^File 1
  -Second Readings
    ^File 1
  -Third Readings
    ^File 1

I've googled for this solution and found some questions that were close to mine but they didn't work.

Like this one How to show the parent and child taxonomy term?

I tried adding a relationship of a Taxonomy Term and then adding another relationship of the Taxonomy Parent. After creating these 2 relationships I tried adding a new field and getting the Taxonomy Term Name and putting its relationship set to the parent. But I get no results at all.

I can post a picture or export my view if it helps. But you dont have the same fields as me so the import may not work correctly for u? I don't export views much...

Any ideas?

views export...

$view = new view();
$view->name = 'legislation';
$view->description = '';
$view->tag = 'default';
$view->base_table = 'file_managed';
$view->human_name = 'Legislation';
$view->core = 7;
$view->api_version = '3.0';
$view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */

/* Display: Master */
$handler = $view->new_display('default', 'Master', 'default');
$handler->display->display_options['title'] = 'Legislation';
$handler->display->display_options['use_more_always'] = FALSE;
$handler->display->display_options['access']['type'] = 'perm';
$handler->display->display_options['cache']['type'] = 'none';
$handler->display->display_options['query']['type'] = 'views_query';
$handler->display->display_options['exposed_form']['type'] = 'basic';
$handler->display->display_options['pager']['type'] = 'none';
$handler->display->display_options['style_plugin'] = 'default';
$handler->display->display_options['style_options']['grouping'] = array(
  0 => array(
    'field' => 'field_legislation_type',
    'rendered' => 1,
    'rendered_strip' => 0,
  ),
);
$handler->display->display_options['row_plugin'] = 'fields';
/* Field: File: Name */
$handler->display->display_options['fields']['field_media_name']['id'] = 'field_media_name';
$handler->display->display_options['fields']['field_media_name']['table'] = 'field_data_field_media_name';
$handler->display->display_options['fields']['field_media_name']['field'] = 'field_media_name';
$handler->display->display_options['fields']['field_media_name']['label'] = '';
$handler->display->display_options['fields']['field_media_name']['element_label_colon'] = FALSE;
/* Field: File: Name */
$handler->display->display_options['fields']['filename']['id'] = 'filename';
$handler->display->display_options['fields']['filename']['table'] = 'file_managed';
$handler->display->display_options['fields']['filename']['field'] = 'filename';
$handler->display->display_options['fields']['filename']['label'] = '';
$handler->display->display_options['fields']['filename']['alter']['word_boundary'] = FALSE;
$handler->display->display_options['fields']['filename']['alter']['ellipsis'] = FALSE;
$handler->display->display_options['fields']['filename']['link_to_file'] = TRUE;
/* Field: File: Legislation Section */
$handler->display->display_options['fields']['field_legislation_type']['id'] = 'field_legislation_type';
$handler->display->display_options['fields']['field_legislation_type']['table'] = 'field_data_field_legislation_type';
$handler->display->display_options['fields']['field_legislation_type']['field'] = 'field_legislation_type';
$handler->display->display_options['fields']['field_legislation_type']['label'] = '';
$handler->display->display_options['fields']['field_legislation_type']['exclude'] = TRUE;
$handler->display->display_options['fields']['field_legislation_type']['element_label_colon'] = FALSE;
$handler->display->display_options['fields']['field_legislation_type']['type'] = 'taxonomy_term_reference_plain';
/* Field: File: File ID */
$handler->display->display_options['fields']['fid']['id'] = 'fid';
$handler->display->display_options['fields']['fid']['table'] = 'file_managed';
$handler->display->display_options['fields']['fid']['field'] = 'fid';
$handler->display->display_options['fields']['fid']['label'] = '';
$handler->display->display_options['fields']['fid']['alter']['alter_text'] = TRUE;
$handler->display->display_options['fields']['fid']['alter']['text'] = '<a href="/media/[fid]">Edit</a>';
$handler->display->display_options['fields']['fid']['element_label_colon'] = FALSE;
/* Sort criterion: File: Upload date */
$handler->display->display_options['sorts']['timestamp']['id'] = 'timestamp';
$handler->display->display_options['sorts']['timestamp']['table'] = 'file_managed';
$handler->display->display_options['sorts']['timestamp']['field'] = 'timestamp';
$handler->display->display_options['sorts']['timestamp']['order'] = 'DESC';
/* Filter criterion: File: Legislation Section (field_legislation_type) */
$handler->display->display_options['filters']['field_legislation_type_tid']['id'] = 'field_legislation_type_tid';
$handler->display->display_options['filters']['field_legislation_type_tid']['table'] = 'field_data_field_legislation_type';
$handler->display->display_options['filters']['field_legislation_type_tid']['field'] = 'field_legislation_type_tid';
$handler->display->display_options['filters']['field_legislation_type_tid']['operator'] = 'not empty';
$handler->display->display_options['filters']['field_legislation_type_tid']['value'] = '';
$handler->display->display_options['filters']['field_legislation_type_tid']['vocabulary'] = 'legislation';

/* Display: Page */
$handler = $view->new_display('page', 'Page', 'page');
$handler->display->display_options['path'] = 'government/council/legislation-test';
  • Please post the export of the view – undersound Apr 7 '13 at 15:48
  • i added my views export to the original post – bghouse Apr 8 '13 at 20:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.