Hi,
I have installed the latest Dev release (2012-Jun-18) to use the display settings for Colorbox Node so we can use the new Colorbox display shown on the Manage Display page.
What I am finding is that the Default display is still being used. If I make changes to Default, those changes come up in the Colorbox and if I make changes to the Colorbox display, these changes do not appear on the site.
I am currently looking through the code to try and fix this but I am unable to find any reference to the display being used.
Is this a work in progress?
Is this functionality not yet present or am I just missing something?
Is there anything I can do to help get this working?
Thanks
Jon
Comments
Comment #1
moss.dev commentedOn further investigation I have found hook_entity_info_alter that seems to be creating the extra tab for the view mode but then the module does not seem to pull this view mode back in.
Am I right in thinking we are only pulling the node in by it's URL without altering or specifying the display type used?
Comment #2
iLLin commentedThats a correct assumption. I am not doing any node_load's anymore, I am doing menu callbacks. So at first guess, there is no way for me to pass a display type to the callback as the module isn't node specific any longer. I wonder if the display type can be passed in the menu callback?
Comment #3
merilainen commentedIs this the right approach? I'm using Features to save the content type settings into their own features and after enabling colorbox_node, all of my features show as overridden because there is this new display type. I wouldn't want to add this module as a dependency to each feature if I'm only using this feature with one of them.
Maybe there could be some checkbox per content type if user wants to enable the display mode, or just instruct users to add a display type called colorbox if they want to have a different display. Then in the code check if that exists, if not, then use the default one. Or something.
Comment #4
iLLin commentedAre you asking if the module using menu_callbacks is the correct approach? Do you have a better way? Also you can turn off display types per content types already, you just uncheck it under the manage displays tab.
I won't be able to change the view mode programmatically until this gets resolved #1154382: View mode no longer can be changed. This is postponed until then.
Comment #5
sludwig commentedA simple (but not very nice) method is to render the nodes yourself with "colorbox" as view_mode. In colorbox_node.module you could replace the line "$html = drupal_render($page_callback_result);" at line 68 with the following code:
The bad with this code is, that the node_view-function is called twice. First in "menu_execute_active_handler" with view_mode full and second in the above customized code with view_mode colorbox.
Comment #6
iLLin commentedGreat work! I don't think its that expensive as the node will already be cached.
Hmm, what happens if you have the colorbox display turned off for the specific content type?
Comment #7
sludwig commentedIf a display-mode is deactivated or simply not available (e.g. if you use a wrong name for the display-mode) the system seems to use the default mode.
In our example, if a user deactivates the custom display settings for the colorbox-mode, the node_view-function call uses the full-mode independent from the given value "colorbox".
Comment #8
iLLin commentedHow about supplying a patch against the latest DEV?
Comment #9
iLLin commentedUpdated the code by sludwig to the latest DEV. Will go back and fix this correctly when core is fixed.