Specific Pager for Views Drupal

This is tip to customize the pager for each views

1. Specific pager themes:

Below is theme functions example for views “blogs”, page view “page_1”

1. 0: “pager__blogs__page_1”
2. 1: “pager__page_1”
3. 2: “pager__”
4. 3: “pager__blogs__page”
5. 4: “pager__page”
6. 5: “pager__blogs”
7. 6: “pager”

2. Register new theme

/**

 * Implementation of hook_theme().

 */

function module_theme() {

  return array(

    'pager__blogs' => array(

      'arguments' => array($tags = array(), $limit = 10, $element = 0, $parameters = array(), $quantity = 9),

    ),

  );

}

function theme_pager__blogs($tags = array(), $limit = 10, $element = 0, $parameters = array(), $quantity = 9) {

  return "hooked?";

}

And bingo, you can customize the pager there.

3. P.S: Copy default pager function at include/pager.inc and paste to hooked Winking smile

Line 115

function theme_pager($tags = array(), $limit = 10, $element = 0, $parameters = array(), $quantity = 9) {

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: