I would like to have the option to exclude a node within the node itself, using a custom checkbox-field. Integrating this with nodes instead of keeping it with the general pagination settings has some advantages. It

  1. eases on usability (option affects a node, so one would edit it within that node)
  2. prevents from having orphaned nid's in the comma separated list (as data from a custom field gets deleted when the node itself is deleted)

I propose the following two lines to be added in pagination.module's function pagination_node_view, directly after

  $ignore = array_map('trim', explode(',', variable_get('pagination_ignore', '') ) );
  /**
  Checks whether current page should have pagination. 
    > Default: all pages of $node->type have pagination
    > When field_disable_pagination is checked, add nid to $ignore  
  **/
  if ($paging && (bool) $node->field_disable_pagination['und'][0]['value'])
    $ignore[] = $node->nid;

The only thing needed besides this, is a custom field named field_disable_pagination on nodes that have pagination enabled, with unchecked value 0 and checked value 1.

Comments

mundanity’s picture

Title: Turn off pagination within nodes » Moving ignore settings from general config to node edit.