Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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.
Comment | File | Size | Author |
---|---|---|---|
#3 | contextual_view_modes-add-context-mobile-detect-support-1859790-3.patch | 954 bytes | steven.wichers |
Comments
Comment #1
sherakama CreditAttribution: sherakama commentedThanks 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 :)
Comment #2
steven.wichers CreditAttribution: steven.wichers commentedI 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
Comment #3
steven.wichers CreditAttribution: steven.wichers commentedContext 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.
Comment #4
steven.wichers CreditAttribution: steven.wichers commentedAnother, 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.Comment #5
byenary CreditAttribution: byenary commentedyep same here silent failing with context breakpoint
Comment #6
sherakama CreditAttribution: sherakama commentedAdded the mobile detect call to latest dev.
Thanks!
Comment #7
sherakama CreditAttribution: sherakama commentedComment #8
deelite CreditAttribution: deelite commentedAre there any news about context breakpoint?