Hi,

I am trying to replace the default pager theme with my own. I added the function mytheme_pager

function myTheme_pager($tags = array(), $limit = 10, $element = 0, $parameters = array(), $quantity = 2) {

}

inside the template.php of my theme, but it does not seem to work. I also added the class

.pager-first
{

width: 25px;
height: 24px;
background-image: url('images/first.png');
background-repeat: no-repeat;
background-color: #FF0000;
}

inside the style.css and while the background-color changes the image it does not shown (the path is verified and its correct).

Any recommedations ?

Comments

aschiwi’s picture

check the function at http://api.drupal.org/api/function/theme_pager/6, copy the whole thing into your template.php and change the function name from function theme_pager to function yourthemename_pager. Also check the comments on that page for some examples.

how are you verifying that the path to your image is correct in css? when you look at it in firebug and you hover over the path part in the css, is the image shown? that would be prove that the path is correct. otherwise use the whole path to the image including the domain part (like so: http://domain.com/sites/all/themes/yourtheme/images/bla.png).

sdancer75’s picture

Hi,

I just copied/pasted to code published by "DeviantArt style pager" at the link you gave me, in my template.php and I changed only the labels below.

  $li_previous = theme('pager_previous', (isset($tags[1]) ? $tags[1] : t('‹ hey prev')), $limit, $element, 1, $parameters);
  $li_next = theme('pager_next', (isset($tags[3]) ? $tags[3] : t('hey next ›')), $limit, $element, 1, $parameters);

I refreshed the page and I saw the same old default result (nothing that says "hey next >"). I have to say that the page is not a simple node but a view that contains images in a grid style. Does this play any role to the final result ?

>>how are you verifying that the path to your image is correct in css?

The path is verified and is correct since my theme's css have the same path and it works correctly.

Regards,

aschiwi’s picture

Well then you're overriding the wrong thing ;) Views pagers are coming from another place. Check the the file theme.inc in the views/theme folder. Depending on which pager you are using (mini pager etc) you find that function (like function theme_views_mini_pager), copy that entire function to your template.php, rename the "theme" part at the beginning of the function to the name of your theme and change what you want. To find all variables available to you, you can temporarily place var_dump($pager_theme);exit; on line 85 in theme.inc within your views/theme folder

sdancer75’s picture

Thank you aschiwi.

You have right, it was my mistake to not mention at all, about the views thing. Anyway, I found the function

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

as yiy said, and I think that I will do my job successfully, but from curiosity, I did not find any full pager function. Why ? Maybe the full pager is inhereted from the core modules ?

Regards,

aschiwi’s picture

You could try and ask that question in the Views issue queue (http://drupal.org/project/issues/views?status=All&categories=All). I only see theme_views_mini_pager as well