2

I am running a Drupal 6 site and I have created a custom block to display a banner ad. The site uses Contexts to display blocks. However I noticed that the block was not getting displayed for anonymous users for some reasons event though I have not set it that way in the reactions. It is getting displayed for user 1 though.

Anyone have any ideas regarding the cause for this scenario?

Also the current block does not have a title? I doubt that but it could be the reason for it not displaying for anonymous users.

  • 1
    check settings for block visibilty – monymirza Jan 2 '13 at 6:06
  • Blocks are actually disabled on the site. Blocks can be accessed via context. – Binny Jan 7 '13 at 6:10
  • Are you using caching modules like e.g. Boost? – Volker Jan 7 '13 at 6:18
  • Yes I am using Boost. However that could only lead to the possibility of not displaying the newer versions of the block right? I dont think that using Boost would get lead to the block not getting called. There are other blocks which are getting displayed on the site without issues. – Binny Jan 7 '13 at 6:56
  • I think this is indeed a Boost problem. However I am not sure why only this particular block is getting affected by Boost. The only uniqueness of this block is that it has an inframe, and the variables change according to taxonomy terms and it has not title. Still Boost should not be preventing the block from being called right?? – Binny Jan 7 '13 at 7:15
1

I found the source of the problem.

I had used hook_block to create the block. I had specified BLOCK_CACHE_GLOBAL for the cache settings of the block which means the blocks were cached the same way irrespective of the page or the user.

I changed the cache setting to BLOCK_CACHE_PER_PAGE and it solved the problem. (The block hosted an openx ad which was only displayed on pages with certain taxonomy terms.)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.