In README.txt I see: In addition, before this is actually utilized you can use hook_panels_everywhere_contexts(&$contexts, $placeholders).

Is this hook supposed to work? It does not for me and I don't see it in code of Panels Everywhere. Maybe it's just outdated documentation or I am doing something wrong. Nothing happens with code below.

function MODULENAME_panels_everywhere_contexts(&$contexts, $placeholders) {
	dsm($contexts);
	dsm($placeholders);
}

Comments

henrijs.seso’s picture

is this the same? _page_manager_contexts_alter(&$contexts, $placeholders)

merlinofchaos’s picture

Ah yes. It appears the README.txt misnames the hook. It's an _alter:

  // Allow other modules to also add contexts to the site template.
  drupal_alter('page_manager_contexts', $contexts, $placeholders);

So that would be hook_page_manager_contexts_alter(&$contexts, $placeholders);

henrijs.seso’s picture

I am testing PA and it appears the docs are off, ill try to provide update when I wrap my mind around it :)

Letharion’s picture

Status: Active » Fixed

Answered by merlin.

merlinofchaos’s picture

Status: Fixed » Active

It sounds like there's a doc update needed here.

Letharion’s picture

Assigned: Unassigned » merlinofchaos
StatusFileSize
new608 bytes

@merlinofchaos
Would you please verify that this gets it right? :)

Letharion’s picture

Status: Active » Needs review
merlinofchaos’s picture

You know, I think the documentation is right and the code is wrong.

the drupal_alter call should be adjusted. This really is a panels_everywhere specific set of contexts and should be namespaced accordingly.

Letharion’s picture

Assigned: merlinofchaos » Letharion
Status: Needs review » Needs work
stevector’s picture

Version: 6.x-1.x-dev » 7.x-1.x-dev
Assigned: Letharion » Unassigned
Category: support » task
Status: Needs work » Needs review
StatusFileSize
new1.22 KB

This naming inconsistency is present in 7.x as well. Here's a patch.

This is an API change. I'm not sure if rc1 is too late for that. If so, Panels Everywhere could call both alter hooks and document the discrepancy.

damienmckenna’s picture

I don't think this needs any further work, e.g. more documentation, but it gets a +1 from me.

damienmckenna’s picture

Title: hook_panels_everywhere_contexts » hook_panels_everywhere_contexts is named incorrectly
Issue summary: View changes
Issue tags: +Needs change record

I'm committing it as-is, but I'll need to do a change notice before the 1.0 release.

damienmckenna’s picture

Title: hook_panels_everywhere_contexts is named incorrectly » Needs change notice: hook_panels_everywhere_contexts is named incorrectly
Status: Needs review » Needs work
damienmckenna’s picture

Status: Needs work » Fixed
Issue tags: +SprintWeekend2015

I've created a draft change record, it'll be published along with 1.0.

Status: Fixed » Closed (fixed)

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