theme snippet

How to make stylesheet refresh automatically

Categories:

When I build a site, I always make changes to the style.css file. I always add, modify or remove styles, but there was a problem. When someone came to see my site they would see an old version of the site because their browser would cache the style.css file. In order to avoid this, I came up with this drupal recipe or theme snippet.

PREV NEXT links for nodes in circular way

Categories:

This is just a sample of how you can add PREV NEXT links to your node type template. This function generates links to navigate your nodes in alphabetical order ASC.

Place Pager at top and bottom of Views view.

Categories:

This code helps you place the pager at top and bottom of your views.

Copy and paste this code into your template.php file.

<?php
function phptemplate_views_view($view, $type, $nodes, $level = NULL, $args = NULL){
   
$output = '';
    if (
$view->use_pager) {
       
$output .= theme('pager', '', $view->pager_limit, $view->use_pager - 1);
    }

   
$output .= theme_views_view($view, $type, $nodes, $level = NULL, $args = NULL);

    return
$output;
}
?>

Tested in drupal 4.x and 5.x

Define new regions in your theme

Categories:

This snippet contains the default regions in the bluemarine theme. I just copy and paste it in the template.php and start adding new ones to the array. And then I define them inside my page.tpl.php

This is very useful if you want to place blocks in custom places and easily manage them from the blocks page.

Syndicate content