Recipe 75: Overriding the theme_pager function
Note
Ingredients
A custom theme (or copy Garland into sites/all/themes
directory)
In Recipe 74, we styled the pager but we could not change the HTML markup with CSS. In this recipe we perform an override of the theme_pager
function to capitalize the words First, Previous, Next, and Last.
Optional step: If you're using the good-old default Garland theme, be sure to copy the whole
garland
directory from<DRUPALROOT>/sites/themes/garland
to a subdirectory of<DRUPALROOT>/sites/all/themes/
.cd <DRUPALROOT>/sites/all/themes/ cp -r ../../../themes/garland/ ./garland-new
Enable and make this new theme the default at
http://YOURSITE.com/admin/build/themes
.Open the
<DRUPALROOT>/include/pager.inc
file, and locate thetheme_pager
function. Copy the function to the clipboard (an alternative location from which to copy the file is http://api.drupal.org/api/5/function/theme_pager).Paste the function at the bottom of the theme's
template...