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;
}
}
?>
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]
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
Sponsored Links
Top Tags
- 120drupal_modules,
- 86drupal_modules_to_watch,
- 75online_tools,
- 71css,
- 66drupal_howto,
- 56drupal,
- 53design,
- 52dev,
- 50drupal_best_modules,
- 46howto,
View All Recent Tags (49)
- 26drupal_modules_to_watch,
- 8drop.io,
- 7drupal_howto,
- 5drupal_performance,
- 4drupal_problems_solved,
- 4drupal_usability,
- 4gardening,
- 3did_not_post_to_delicious,
- 2htaccess,
- 2drupal_multisite,
- 2webserver,
- 2drupal_sites,
- 2font-families,
- 2p_commondreams_modules,
- 2CiviCRM,
- 2plesk,
- 2droplits_work,
- 2salsa,
- 2twitter,
- 2iran,
- 2drupal_theme,
- 2subversion,
- 2howto,
- 2wampserver,
- 2drupal_ubercart,
- 2jquery_plugin,
- 1p_commondreams,
- 1drupal_block,
- 1drupal_to_read,
- 1ssh,
- 1slicehost,
- 1drupal_open_atrium,
- 1css,
- 1drupal_module_comparison,
- 1andLinux,
- 1wamp,
- 1social_web,
- 1cache,
- 1civimail,
- 1bash,
- 1content_migration,
- 1page_of_links,
- 1wireframes,
- 1mockups,
- 1for_andy,
- 1drupal_seo,
- 1drupal_og,
- 1drupal_developmentseed,
- 1online_tools
Public Tags (281)
Scott Blackburn's Public Lists (13)
Highlighter, Sticky notes, Tagging, Groups and Network: integrated suite dramatically boosting research productivity. Learn more »
Join Diigo