Earl has done some awesome work to support addressable content (a string that encapsulates the necessary context to render a pane or other item) in CTools and Panels recently. Panelizer currently supports addressable content and there's some (admittedly untested) work already present in Panels proper. Using this information will allow us to do Panels ESI in a much simpler way without needing to add as much functionality to figure out $pane->id and $display->id.

I have a sandbox at http://drupal.org/sandbox/smerrill/1508550 which contains the first working version of integration with addressable content (and thus ESI for Panelized entities today.) It still definitely needs some work - for one, some of my old code from my old sandbox is in still in the Panels cache provider, and additionally, I have ripped out some of the old detection code but not all of it.)

I have two main questions:

  • Manarth, how many folks currently use ESI 7.x-3.x, and specifially do you know if many use it for Panels? Basically, Do we need to worry about providing backwards compatibility with the existing Pane ID / Display ID detection?
  • Earl, since addressable content is now in present in some form in both Panels and Panelizer, do you see any reason that we shouldn't go down this path?

If we decide that yes, addressable content is The Future, I will continue ripping out the old code as much as possible and get us a patch post haste.

Comments

I think addressable content is the only way to truly re-render panes because it retains context. The one issue is that some applications of Panels may not support or properly support it, so we'll need to check them all. Panelizer is the only one that's been tested, but there are others that will need to have the proper code path put in. Still, effort here makes that happen, and copying the code from Panelizer should not be difficult.

Hey Steve. ATM adoption is limited in 7.x-3 due to the fact it's relatively new. I would say back compatability isn't of consern at this point in time

Regards

Dave

Here's some of the work in progress as a patch so that people can start looking at it.

This code also lives in the 7.x-3.x-addressable branch of http://drupal.org/node/1508550 and I push there regularly.

Here's the current list of changes incorporated in this branch:

  • Support for addressable content in the ESI URL generation as well as in the /esi/panels_pane menu callback
  • Removal of the old pane/display calculation
  • Adding proper CACHE=(USER|ROLE) strings as with the block provider
  • The start of work on also doing object caching on panes (this is in the roughest shape at the moment)
  • Several instance of code style cleanup
  • The ability to write custom Panels cache providers that start with "esi" and have _esi_panels__display_uses_esi() return TRUE
  • Calling drupal_page_is_cacheable() so that ESI fragments do not end up in the page cache (this is mostly preventative)

This has thus far been tested with Panelizer 7.x-2.x-dev (you will need commit ad74076).

Should the status of this be moved to needs review?

@Steve Merrill: How's your progress going, is it stable yet?