Download & Extend

Integration with Context Layout

Project:Custom Page
Version:6.x-1.9
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:needs review

Issue Summary

It would be useful to integrate Custom Page with Context Layout. The ideal use for this would be a landing page that you still want non-developers to be able to change.

You could create a custom page, set a context. Then the reaction to that is a context layout. You can then put blocks into the relevant regions.

Custom Page lets you do this but will throw an error because there won't be any template file. It would be useful to break this dependancy on having template files.

My patch looks to see if one of the set contexts has a context layout reaction. If so it does not give an error and renders the page as normal.

AttachmentSize
context_layout_patch.patch598 bytes

Comments

#1

Having undergone a crash course in git today and learned about unified patches I submit a unified version of the previous patch.

AttachmentSize
context_layout_patch.patch 1.13 KB

#2

Status:active» needs work

eoriordan,

that's an interesting idea, but there're two problems with the patch:

1. code will fail if context_layout module is not enabled because you are introducing hard dependency. We need code that will implement your logic when/if context_layout module is present (I would check on the existence of the function you are calling, rather than module_exist, since former is probably faster, however we should probably test which one is faster), but run old, context_layout-unaware code if the module is not present.

2. if we add functionality to 6.x branch, we should add it to 7.x one too. Any chance you might be able to roll a patch for that too?

Thanks!

#3

code will fail if context_layout module is not enabled because you are introducing hard dependency.

I have fixed this now by added a test for the existence of the Context function we call. This is with a simple function_exists() test.

AttachmentSize
context_layout-1081078.patch 1.26 KB

#4

Status:needs work» needs review

Here is a d7 version.

I ran into this issue when testing #1108510: Activating Context Layouts should not make the blocks reaction disappear which meant I could not test against Context 7.x-3.0-beta1. With the dev version of Context for d7 this issue is resolved and the patch works perfectly.

AttachmentSize
context_layout_d7-1081078.patch 1.13 KB