Skip to main content

Scott Blackburn

Scott Blackburn's Public Library

03 Nov 09

how to display block when any page in specific book is shown? | drupal.org

  • blocks don't load the node, hence the arg and nid approach. this will do what you want, but only works in Drupal 6.

    parent method will work, but only two levels deep. you'll have to add a bit more logic if you want it to work with children of children.

    <?php
    if (arg(0) == 'node' && is_numeric(arg(1))) {
     
    $nid = arg(1);
     
    $node = node_load(array('nid' => $nid));
    if (
    $node->book['bid']==41) {
    return
    TRUE;
    }
    else {
    return
    FALSE;
    }
    }

    ?>
13 Oct 09

Access all multisites with www. only [.htaccess] | drupal.org

  • # non empty HTTP_HOST in the request
            RewriteCond %{HTTP_HOST} !^$ [NC]  

    #here you exclude a domain from the universal rules
            RewriteCond %{HTTP_HOST} !^www\.excepteddomain\.com$ [NC]
            RewriteCond %{HTTP_HOST} !^excepteddomain\.com$ [NC]


    # the hostname does start with 'www.'
            RewriteCond %{HTTP_HOST} ^www\. [NC]
    # let's extract the hostname without 'www.' and save it to %1
            RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
    # let's redirect to the extracted hostname, $1 saves the URL
            RewriteRule ^(.*)$ "http://%1/$1" [L,R=301]

    #here are the rules for the excepted domain
           RewriteCond %{HTTP_HOST} excepteddomain\.com$ [NC]
           RewriteCond %{HTTP_HOST} !^www\.excepteddomain\.com$ [NC]
           RewriteRule ^(.*)$ http://www.excepteddomain.com/$1 [L,R=301]

05 Oct 09

Adding more body classes for page-specific CSS targeting | drupal.org


  • To anyone who implements this themselves, note that the ending bracket didn't make it's way into the code above. Should be:

Home | Community

Community site for Open Atrium built with Open Atrium

community.openatrium.com/home - Preview

drupal_sites drupal_open_atrium

1 - 20 of 1165 Next › Last »
Showing 20 items per page

Highlighter, Sticky notes, Tagging, Groups and Network: integrated suite dramatically boosting research productivity. Learn more »

Join Diigo