it-swarm-id.com

Tampilan dan jumlah simpul untuk istilah taksonomi

Bagaimana saya bisa menampilkan nilai jumlah simpul untuk istilah taksonomi di Views? dengan mengurutkan daftar hasil dalam urutan jumlah node.

31
ya.teck
  1. Buat tampilan taksonomi
  2. Tambahkan grup simpul dalam hubungan
  3. Tambahkan nama panjang dan bidang nid simpul untuk tampilan
  4. Aktifkan agregasi di bagian "Lainnya" (Gunakan agregasi: Ya)
  5. Klik ikon pengaturan bidang nid, pilih jenis grup "hitung".

Temukan ekspor tampilan yang sesuai untuk saya.

$view = new view;
$view->name = 'term_node_count';
$view->description = 'Displays node count values for terms';
$view->tag = '';
$view->base_table = 'taxonomy_term_data';
$view->human_name = 'term_node_count';
$view->core = 7;
$view->api_version = '3.0-alpha1';
$view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */

/* Display: Defaults */
$handler = $view->new_display('default', 'Defaults', 'default');
$handler->display->display_options['use_ajax'] = TRUE;
$handler->display->display_options['group_by'] = TRUE;
$handler->display->display_options['access']['type'] = 'none';
$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'] = '100';
$handler->display->display_options['pager']['options']['offset'] = '0';
$handler->display->display_options['pager']['options']['id'] = '0';
$handler->display->display_options['pager']['options']['expose']['items_per_page_options_all'] = 0;
$handler->display->display_options['style_plugin'] = 'table';
$handler->display->display_options['style_options']['columns'] = array(
  'name' => 'name',
  'nid' => 'nid',
);
$handler->display->display_options['style_options']['default'] = '-1';
$handler->display->display_options['style_options']['info'] = array(
  'name' => array(
    'sortable' => 0,
    'default_sort_order' => 'asc',
    'align' => '',
    'separator' => '',
  ),
  'nid' => array(
    'sortable' => 0,
    'default_sort_order' => 'asc',
    'align' => '',
    'separator' => '',
  ),
);
$handler->display->display_options['style_options']['override'] = 1;
$handler->display->display_options['style_options']['sticky'] = 0;
/* Relationship: Taxonomy: Node */
$handler->display->display_options['relationships']['nid']['id'] = 'nid';
$handler->display->display_options['relationships']['nid']['table'] = 'taxonomy_index';
$handler->display->display_options['relationships']['nid']['field'] = 'nid';
$handler->display->display_options['relationships']['nid']['required'] = 0;
/* Field: Taxonomy: Term */
$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']['alter']['alter_text'] = 0;
$handler->display->display_options['fields']['name']['alter']['make_link'] = 0;
$handler->display->display_options['fields']['name']['alter']['absolute'] = 0;
$handler->display->display_options['fields']['name']['alter']['trim'] = 0;
$handler->display->display_options['fields']['name']['alter']['Word_boundary'] = 1;
$handler->display->display_options['fields']['name']['alter']['Ellipsis'] = 1;
$handler->display->display_options['fields']['name']['alter']['strip_tags'] = 0;
$handler->display->display_options['fields']['name']['alter']['html'] = 0;
$handler->display->display_options['fields']['name']['element_label_colon'] = 1;
$handler->display->display_options['fields']['name']['element_default_classes'] = 1;
$handler->display->display_options['fields']['name']['hide_empty'] = 0;
$handler->display->display_options['fields']['name']['empty_zero'] = 0;
$handler->display->display_options['fields']['name']['link_to_taxonomy'] = 1;
/* Field: Node: Nid */
$handler->display->display_options['fields']['nid']['id'] = 'nid';
$handler->display->display_options['fields']['nid']['table'] = 'node';
$handler->display->display_options['fields']['nid']['field'] = 'nid';
$handler->display->display_options['fields']['nid']['relationship'] = 'nid';
$handler->display->display_options['fields']['nid']['group_type'] = 'count';
$handler->display->display_options['fields']['nid']['label'] = 'Count';
$handler->display->display_options['fields']['nid']['alter']['alter_text'] = 0;
$handler->display->display_options['fields']['nid']['alter']['make_link'] = 0;
$handler->display->display_options['fields']['nid']['alter']['absolute'] = 0;
$handler->display->display_options['fields']['nid']['alter']['trim'] = 0;
$handler->display->display_options['fields']['nid']['alter']['Word_boundary'] = 1;
$handler->display->display_options['fields']['nid']['alter']['Ellipsis'] = 1;
$handler->display->display_options['fields']['nid']['alter']['strip_tags'] = 0;
$handler->display->display_options['fields']['nid']['alter']['html'] = 0;
$handler->display->display_options['fields']['nid']['element_label_colon'] = 1;
$handler->display->display_options['fields']['nid']['element_default_classes'] = 1;
$handler->display->display_options['fields']['nid']['hide_empty'] = 0;
$handler->display->display_options['fields']['nid']['empty_zero'] = 0;
$handler->display->display_options['fields']['nid']['link_to_node'] = 1;

/* Display: Block */
$handler = $view->new_display('block', 'Block', 'block_1');
$translatables['term_node_count'] = array(
  t('Defaults'),
  t('more'),
  t('Apply'),
  t('Reset'),
  t('Sort By'),
  t('Asc'),
  t('Desc'),
  t('Items per page'),
  t('- All -'),
  t('Offset'),
  t('node'),
  t('Term'),
  t('Count'),
  t('Block'),
);
42
Sivaji

Semua jawaban sebelumnya sangat membantu.

Saya ingin mendapatkan meja sehingga saya bisa membiarkan pengguna mengurutkan berdasarkan Term atau berdasarkan hitungan.

Untuk melakukan ini saya:

  1. Hubungan> Istilah taksonomi: Konten dengan term
  2. Gunakan agregasi: Ya
  3. Bidang> Konten: Nid
  4. Jenis agregasi untuk Nid = Hitung DISTINCT
23
chrowe

Untuk mendapatkan jumlah taksonomi node yang benar untuk istilah taksonomi Anda perlu melakukan hal berikut:

  1. Dalam Fileds: tambahkan istilah Taksonomi: Nama
  2. Dalam Hubungan, tambahkan istilah Taksonomi: Konten dengan istilah
  3. Tambahkan filter kontekstual untuk istilah taksonomi: Nama

    3a. Pilih 'Tampilkan ringkasan'

    3b. Pilih 'Tampilkan jumlah Rekaman dengan tautan'. Tetapkan juga jalur dasar jika Anda ingin halaman taksonomi dihubungkan dengan benar.

12
Nevos

Kuncinya adalah Anda telah memastikan bahwa Anda telah mencentang kotak "agregasi" di opsi lanjutan tampilan.

5
Chunty

Tambahkan argumen (dinamai 'filter kontekstual' di Tampilan terbaru) untuk istilah taksonomi, dan pilih 'Tampilkan ringkasan'. Kemudian, pilih untuk menampilkan 'Jumlah catatan'.

4
tim.plunkett