Hi Guys,

I want to change the pagination of the drupal admin panel taxonomy term list page. In panel when i display the term datas if it is more than 100, automatically a pagination appears how can i configure it and remove it?

Thank you

Comments

jkwilson’s picture

I found that the limit per page is set by a variable in the taxonomy module. There's a call to get the value on Line 262 of taxonomy.admin.inc:

$page_increment = variable_get('taxonomy_terms_per_page_admin', 100); // Number of terms per page.

But unless I'm overlooking something, it's never actually SET in the code, and it's not configurable. So it always hits the default. This caused me some problems because I wanted to do some custom sorting of one of our taxonomy term lists, but finding it impossible when the list is paginated. Every time I save the order, the weights are reset. So there's no way to move items between pages, for example.

The simple workaround in my case was to set this default a bit higher, allowing the whole list to display on one page. Obviously I don't want to be changing anything in core, but I haven't found a more straightforward fix yet.

gamesfrager’s picture

I'm in the same situation. I have 8 pages of terms and I have terms on the 3rd page that I want to bring to first page. Not possible without this hack of showing them all on one page by setting the limit way too high.

Please allow the items per page to by dynamic this way I can bring the term to the top of the page, set the items per page higher and this will bring the term to the bottom of the previous page...and so on

keep jumping until I reach the page I want. And maybe include a "Show All" option.

kukle’s picture

Same problem. Subscribing

It's not the size of the hump, it's the movement of the camel that's important...

lucas meyer’s picture

This is easy to set with drush. For instance, to set number of items per page to 500:
drush vset taxonomy_terms_per_page_admin 500

Anonymous’s picture

We need a "thumbs up" button! Thank you very much for this.

dca123’s picture

For those still looking for a solution as I was:

You can

  • create a new page
  • make the input type PHP code
  • paste the following code
  • Save or Preview the page
<?php
variable_set ('taxonomy_terms_per_page_admin',1000);
?>

where 1000 is the number of terms to show before the next page...

jackdaniel9’s picture

With commerce Kickstart 2.09

After set -> taxonomy_terms_per_page_admin to 1000

I have this error and i have 300 term.

Notice : Undefined index: tid:27:0 dans taxonomy_overview_terms() (ligne 352 dans /home/cafe/public_html/modules/taxonomy/taxonomy.admin.inc).
Notice : Undefined index: tid:30:0 dans taxonomy_overview_terms() (ligne 352 dans /home/cafe/public_html/modules/taxonomy/taxonomy.admin.inc).
Notice : Undefined index: tid:211:0 dans taxonomy_overview_terms() (ligne 352 dans /home/cafe/public_html/modules/taxonomy/taxonomy.admin.inc).
Notice : Undefined index: tid:319:0 dans taxonomy_overview_terms() (ligne 352 dans /home/cafe/public_html/modules/taxonomy/taxonomy.admin.inc).
Notice : Undefined index: tid:167:0 dans taxonomy_overview_terms() (ligne 352 dans /home/cafe/public_html/modules/taxonomy/taxonomy.admin.inc).
etc.....
etc.....
etc.....
etc.....

StarBoyX’s picture

For hook_menu

/**
 * Implements hook_menu().
 */
function my_module_menu() {
  $items = array();
  $items['admin/config/system/taxonomy_terms_per_page_admin'] = array(
    'title' => 'Set count of taxonomy terms per page',
    'page callback' => 'drupal_get_form',
    'page arguments' => array('my_module_taxonomy_terms_per_page_admin_form'),
    'access arguments' => array('administer site configuration'),
    'type' => MENU_NORMAL_ITEM,
  );

  return $items;
}

And form

/**
 * Implements hook_form().
 */
function my_module_taxonomy_terms_per_page_admin_form($form, &$form_state) {
  $form = array();
  $form['taxonomy_terms_per_page_admin'] = array(
    '#title' => t('Count of taxonomy terms per page'),
    '#type' => 'textfield',
    '#default_value' => variable_get('taxonomy_terms_per_page_admin', 100)
  );

  return system_settings_form($form);
}

Gastonia’s picture

Does anyone have an idea of how this is accomplished in Drupal 8 with Drush 8 and 9? I'm getting command not found.

peterue’s picture

drush config:set taxonomy.settings terms_per_page_admin 500
akanchha’s picture

Attaching the patch for drupal 8.4. It removes the pagination from taxonomy in backend.

diff --git a/core/modules/taxonomy/src/Form/OverviewTerms.php b/core/modules/taxonomy/src/Form/OverviewTerms.php
index 3811ee5..1ca2035 100644
--- a/core/modules/taxonomy/src/Form/OverviewTerms.php
+++ b/core/modules/taxonomy/src/Form/OverviewTerms.php
@@ -169,10 +169,6 @@ public function buildForm(array $form, FormStateInterface $form_state, Vocabular
       if ($page_entries == 1) {
         $form['#first_tid'] = $term->id();
       }
-      // Keep a variable to make sure at least 2 root elements are displayed.
-      if ($term->parents[0] == 0) {
-        $root_entries++;
-      }
       $current_page[$key] = $term;
     } while (isset($tree[++$tree_index]));
 
@@ -362,8 +358,6 @@ public function buildForm(array $form, FormStateInterface $form_state, Vocabular
         '#value' => $this->t('Reset to alphabetical'),
       ];
     }
-
-    $form['pager_pager'] = ['#type' => 'pager'];
     return $form;
   }