When I used this module on an existing site which uses context for block placement, all the blocks dissapeared.

This is because both modules use theme_blocks. It was fixed with a couple lines of code (see patch).

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

askibinski’s picture

With above patch in place and the one included in the next comment, you can just use the tpl.php file provided by context called "context-block-editable-region.tpl.php" and override it with someting like:

<?php foreach ($blocks as $block): ?>
<?php 
$esi_config = _esi__block_settings($block->module, $block->delta);
?>
<?php if ($esi_config->enabled == 1) : ?>
  <?php print theme('esi_tag', $block); ?>
<?php else : ?>
  <?php print theme('block', $block); ?>
<?php endif; ?>
<?php endforeach; ?>

In addition you also need to patch esi.inc which handles the request for the block content. Otherwise the core block_list will provide an empty array because block placement is handled by context.

Not sure if this is the best way to do this, but it worked for me...

askibinski’s picture

FileSize
972 bytes

patch mentioned in #2. Should be used together with patch in #1.

mikeytown2’s picture

Version: 6.x-1.0-beta1 » 6.x-2.x-dev
Status: Needs review » Fixed

This has been fixed in the 2.x branch. If I am mistaken please re-open.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

dropchew’s picture

Version: 6.x-2.x-dev » 7.x-3.0-alpha1
Status: Closed (fixed) » Active

Hi,

Reopening for 7.x version. I enabled the esi context module but the block added by context are gone... am I missing something? thanks!

manarth’s picture

Version: 7.x-3.0-alpha1 » 6.x-2.x-dev
Status: Active » Closed (fixed)

Hi Dropchew,

If you're still experiencing the same problem, can you open a new ticket? ESI does have support for working with context. Perhaps the block disappeared because it's being rendered as an tag, and varnish isn't processing ESI tags? If so, the new Ajax rendering feature may help, by providing a client-side fallback renderer.