Skip to main content
Prevent php notices by making sure $node->type is set
Source Link
mikeytown2
  • 8.3k
  • 1
  • 33
  • 46

See if http://drupal.org/project/cacheexclude can do it for you. If not you need to create a module that will implement hook_init. Inside of that hook you need to load the node from arg() from there see if the node is of a certian type; if it is disable the page cache.

<?php
  // Get the current active node object if present.
  $node = menu_get_object();
  if (!empty($node) && !empty($node->type) && $node->type == 'page') {
    drupal_page_is_cacheable(FALSE);
  }
?>

See if http://drupal.org/project/cacheexclude can do it for you. If not you need to create a module that will implement hook_init. Inside of that hook you need to load the node from arg() from there see if the node is of a certian type; if it is disable the page cache.

<?php
  // Get the current active node object if present.
  $node = menu_get_object();
  if (!empty($node) && $node->type == 'page') {
    drupal_page_is_cacheable(FALSE);
  }
?>

See if http://drupal.org/project/cacheexclude can do it for you. If not you need to create a module that will implement hook_init. Inside of that hook you need to load the node from arg() from there see if the node is of a certian type; if it is disable the page cache.

<?php
  // Get the current active node object if present.
  $node = menu_get_object();
  if (!empty($node) && !empty($node->type) && $node->type == 'page') {
    drupal_page_is_cacheable(FALSE);
  }
?>

See if http://drupal.org/project/cacheexclude can do it for you. If not you need to create a module that will implement hook_init. Inside of that hook you need to load the node from arg() from there see if the node is of a certian type; if it is disable the page cache.

<?php
$arg = arg();
if (isset($arg[0]) &&// isset($arg[1])Get &&the $arg[0]current ==active 'node'node &&object is_numeric($arg[1]))if {present.
  $node = node_loadmenu_get_object($arg[1]);
  if (!empty($node) && $node->type == 'page') {
    drupal_page_is_cacheable(FALSE);
  }
}
?>

See if http://drupal.org/project/cacheexclude can do it for you. If not you need to create a module that will implement hook_init. Inside of that hook you need to load the node from arg() from there see if the node is of a certian type; if it is disable the page cache.

<?php
$arg = arg();
if (isset($arg[0]) && isset($arg[1]) && $arg[0] == 'node' && is_numeric($arg[1])) {
  $node = node_load($arg[1]);
  if ($node->type == 'page') {
    drupal_page_is_cacheable(FALSE);
  }
}
?>

See if http://drupal.org/project/cacheexclude can do it for you. If not you need to create a module that will implement hook_init. Inside of that hook you need to load the node from arg() from there see if the node is of a certian type; if it is disable the page cache.

<?php
  // Get the current active node object if present.
  $node = menu_get_object();
  if (!empty($node) && $node->type == 'page') {
    drupal_page_is_cacheable(FALSE);
  }
?>
Source Link
mikeytown2
  • 8.3k
  • 1
  • 33
  • 46

See if http://drupal.org/project/cacheexclude can do it for you. If not you need to create a module that will implement hook_init. Inside of that hook you need to load the node from arg() from there see if the node is of a certian type; if it is disable the page cache.

<?php
$arg = arg();
if (isset($arg[0]) && isset($arg[1]) && $arg[0] == 'node' && is_numeric($arg[1])) {
  $node = node_load($arg[1]);
  if ($node->type == 'page') {
    drupal_page_is_cacheable(FALSE);
  }
}
?>