Hello everyone

I want to exclude this
http://www.renovacionmagisterial.org/portada/emisora

In this page, I want to load certain content, but just at certain hour. So I have some like this in the mymodule.block.tpl.php for a block for this page:

<?php
if($actual_hour == $happy_hour){
  showAmazingStuff();
}
else{
  showOtherStuff();
}
?>

Being "portada" the root folder, I add "emisora" in
/admin/config/system/cacheexclude

In admin/config/development/performance
I have checked all the items, and I have set "1 day" for the times

It seems don't work. It do showOtherStuff() always, until I do:
admin/config/development/performance CACHE FLUSH, then it do showAmazingStuff();
* In happy_hour, off course

What I'm missing?

Thanks

Comments

Augusto182’s picture

Title: Don't Work in this case » Don't Work in this case (¿solve?)
Priority: Critical » Normal
Status: Active » Needs review

Hello... I just did the next:

function mymodule_block_info() 
{
  $blocks['myBlock'] = array(
    // ... stuff
   'cache' => DRUPAL_NO_CACHE,
  );
  
  return $blocks;
}

And... It Works...

But I don't sure if this is the best way,

I would like that block be cached all the time, except for that "happy_hour"... any suggestion?

Augusto182’s picture

Issue summary: View changes
texas-bronius’s picture

Hi - Just looking at your original post, if you are requesting to exclude, literally, "emisora" then that is what will be excluded. Probably you want to add to your Cache Exclude settings the full path:
portada/emisora
Of course, if you have subpages like node ids or whatever you might also want

portada/emisora
portada/emisora/*

Hope this helps -- Cheers
-Bronius

texas-bronius’s picture

Title: Don't Work in this case (¿solve?) » CacheExclude: Don't Work in this case (¿solve?)
Status: Needs review » Closed (works as designed)