Contextual View Modes does not seem to respond to conditions provided by the modules Context Mobile Detect and Context Breakpoint.

I've confirmed that Contextual View Modes works with the default conditions provided by context like Node Type, and I've confirmed Context Breakpoint and Context Mobile Detect to work in situations not involving Contextual View Modes. I'm not sure where the breakdown is, as everything seems to be failing silently, but this module seems to be the common factor in use with either of those modules.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

sherakama’s picture

Thanks for this. I will take a look and see what it will take to make this work with those add on context modules. No promises :)

steven.wichers’s picture

I just started looking in to this. First glance shows that contextual_view_modes_node_view_alter() is being called before any contexts are set via context_context().

Related issue? #1136270: block_view_alter

steven.wichers’s picture

Status: Active » Needs review
FileSize
954 bytes

Context does not currently provide a hook for modules to use that will fire early enough in the process to allow this module to function. I have created a patch that specifically looks for the context mobile module and then calls its condition function directly. I tested it on the current site I am developing and got different view modes based on mobile or not mobile.

steven.wichers’s picture

Another, slightly more generic way to do this is to call module_invoke_all('context_page_reaction'); instead. This is what I wound up doing for a custom module that had a similar issue. This works, but isn't ideal because there really should be block specific hooks within Context.

byenary’s picture

yep same here silent failing with context breakpoint

sherakama’s picture

Added the mobile detect call to latest dev.

Thanks!

sherakama’s picture

Issue summary: View changes
Status: Needs review » Closed (fixed)
deelite’s picture

Are there any news about context breakpoint?