You are here

entity_pager.module in Entity Pager 7

Same filename and directory in other branches
  1. 8 entity_pager.module
  2. 2.0.x entity_pager.module

This module allows you to add Pager blocks to navigate through entities.

File

entity_pager.module
View source
<?php

/**
 * @file
 * This module allows you to add Pager blocks to navigate through entities.
 */

/**
 * Implements hook_help().
 */
function entity_pager_help($path, $arg) {
  switch ($path) {
    case 'admin/help#entity_pager':
      $output = '';
      $output .= t('<h3>About</h3>');
      $output .= t('<p>Provides next and previous navigation on entities.<p>');
      $output .= t('<p> &nbsp e.g.<p>');
      $output .= t('<p> &nbsp < prev &nbsp All &nbsp next ><p>');
      $output .= t('<p>You can add multiple different navigation blocks on the same entity. This module combines Views, Blocks, Tokens and has its own internal intelligent advice system giving tips that are published to Watchdog (optionally). It is designed to run fast with the minimum of processing.</p>');
      $output .= t('<p>It is simple to use, allowing you can create Navigation blocks in a few seconds. For more complex pagers, it can combine with the Entity Reference module to create generic sub-navigation on related entities.</p>');
      $output .= t('<p> &nbsp e.g. navigate through a Brands products or go back to the Brand page itself.</p>');
      $output .= t('<p> &nbsp < prev &nbsp Pepsi &nbsp next ></p>');
      $output .= t('<p><strong>Demonstration Block/View:</strong></p>');
      $output .= t('<p>When turning on this module an Entity Pager demonstration View block is created called: <strong>Entity Pager Example</strong>.  Enable this block in a region of your theme on a page with a node on and this will display an Entity Pager block for nodes.</p>');
      $output .= t('<p>See demonstration video at:  <a href="https://youtu.be/oJUcjKLz8ls" title="Entity Pager module on YouTube" rel="nofollow">Entity Pager module on YouTube</a>');
      return $output;
  }
}

/**
 * Implements hook_views_api().
 *
 * This one is used as the base to reduce errors when updating.
 */
function entity_pager_views_api() {
  return array(
    'api' => '3.0',
    'path' => drupal_get_path('module', 'entity_pager') . '/views',
  );
}

/**
 * Implements hook_theme().
 */
function entity_pager_theme() {
  $themes = array();
  $themes['entity_pager'] = array(
    'variables' => array(
      'list' => array(),
    ),
    'template' => 'entity_pager',
  );
  return $themes;
}

/**
 * Implements template_preprocess_hook().
 *
 * Added a minimalistic amount of CSS to the page to style Entity Page.
 * A minimalistic amount of CSS has deliberately only been added so it is easy
 * to override the CSS in the theme layer.
 *
 * @param array $variables
 *   An associative array of $variables passed into template.
 */
function template_preprocess_entity_pager(array &$variables) {
  drupal_add_css(drupal_get_path('module', 'entity_pager') . '/css/entity_pager.css');
}

Functions

Namesort descending Description
entity_pager_help Implements hook_help().
entity_pager_theme Implements hook_theme().
entity_pager_views_api Implements hook_views_api().
template_preprocess_entity_pager Implements template_preprocess_hook().