1

I have Dictionary with several taxonomy terms. When I use Edit tab near each term in Structure/Taxonomy I see that I can give weight for any term. Also I can drug and drop them in any order in list of terms for my vocabluary. More than it, when I after this procedure go and look at weights - they are in new order.

So, problem is that then I use Views to make block with my taxonomy terms (I use unformated list) and use Taxonomy weight as sorting criteria - sorting always goes in alfabetic order.

And when I made additional field in View to show terms weight - I found out that all terms have weight -8. How I can make term order in my Views display according to their weight?

Thank you.

  • 'Taxonomy term:Weight' should do it. The issue is: Why do your terms not stay in the order after you dragged them, and why do they all have the same weight. (Can it be cause you drug and drop them?) Make sure you used 'taxonomy term:weight' and not 'taxonomy vocabulary:weight' – J. Reynolds Nov 21 '14 at 12:02
  • Thank you very much! I really tried to do it with vocabulary weight. – user38998 Nov 21 '14 at 14:07
  • But I found another problem. If I add another field to be shown - image, sorting by term weight do not work. This field is part of Taxonomy entity. So I take first field - term name, and sercond field - image for this name. Both are part of Taxonomy. – user38998 Nov 21 '14 at 15:06
1

I've done same setup and working fine. Might be you've missed something. Import the below code into your view.

$view = new view();
$view->name = 'List of Tags';
$view->description = '';
$view->tag = 'default';
$view->base_table = 'taxonomy_term_data';
$view->human_name = 'Tags List';
$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'] = 'List of Tags';
$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'] = 'full';
$handler->display->display_options['pager']['options']['items_per_page'] = '10';
$handler->display->display_options['style_plugin'] = 'default';
$handler->display->display_options['row_plugin'] = 'fields';
/* Field: Taxonomy term: Name */
$handler->display->display_options['fields']['name']['id'] = 'name';
$handler->display->display_options['fields']['name']['table'] = 'taxonomy_term_data';
$handler->display->display_options['fields']['name']['field'] = 'name';
$handler->display->display_options['fields']['name']['label'] = '';
$handler->display->display_options['fields']['name']['alter']['word_boundary'] = FALSE;
$handler->display->display_options['fields']['name']['alter']['ellipsis'] = FALSE;
$handler->display->display_options['fields']['name']['link_to_taxonomy'] = TRUE;
/* Filter criterion: Taxonomy term: Vocabulary */
$handler->display->display_options['filters']['vid']['id'] = 'vid';
$handler->display->display_options['filters']['vid']['table'] = 'taxonomy_term_data';
$handler->display->display_options['filters']['vid']['field'] = 'vid';
$handler->display->display_options['filters']['vid']['value'] = array(
  1 => '1',
);

/* Display: Page */
$handler = $view->new_display('page', 'Page', 'page');
$handler->display->display_options['path'] = 'tags-list';
$translatables['sdf'] = array(
  t('Master'),
  t('List of Tags'),
  t('more'),
  t('Apply'),
  t('Reset'),
  t('Sort by'),
  t('Asc'),
  t('Desc'),
  t('Items per page'),
  t('- All -'),
  t('Offset'),
  t('« first'),
  t('‹ previous'),
  t('next ›'),
  t('last »'),
  t('Page'),
);

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.