We recently finished a project which required a 16 column layout, some pages had a main content are of 10 units with the sidebar being 6 units, whilst other pages required the main content region to have a width of 11 units with a sidebar width of 5.
The client had a small budget, so we didn't have much time to look into this deeply - the solution(hack) we used was to set the first and last sidebar to be 5 and 6 units respectively and add content to each depending on layout. Not ideal, but it worked, but not really sustainable and required a lot of fiddling with contexts and block layouts in regions.
So, now the project has finished i've started looking at a way to modify the grid on a per context of per page(node) basis. I know this type of flexibility is on the horizon in D8 (think Dries mentioned it in one of his blog posts), but I was wondering on an approach with Fusion in D7.
- First thoughts are:
1) A small module to add a field/switch to the node form (11:5, 10:6 or whatever - maybe even set multiple columns)
2) Then add a preprocess function which looks at this field setting or context and modifies the pages classes and grid variables appropriately.
So, my question is, what's the best way to modify the grid calculation? I've had a dig in the fusion template.php and dpm'd the grid variables, but could use some guidance on the best way to approach this.
Any help much appreciated - and thanks for all the hard work on fusion and accelerator , which look awesome so far :-)
Comments
Comment #1
sheena_d commentedThe best way to do this with Fusion involves using the Fusion Accelerator, Delta and Context modules.
Delta allows you to create multiple versions of your theme's settings. Utilizing the Responsive theme settings provided by Fusion Accelerator, you can create different layouts that use a different number of columns, different settings for sidebar widths and even a different full-page width. If you don't want the site to actually resize for responsive devices, you can turn off the responsive settings for all devices except desktop.
Then, using the context module, you can apply each of the sets of theme settings defined in Delta to different pages in the site. Take a look at the Delta and Context modules' documentation for more information.
Cheers,
Sheena
Comment #2
hixster commentedSheena that's awesome. Thanks for pointing me towards Delta, that definately looks like the missing piece of the puzzle.
Thanks for following up so quickly.
Comment #3
esmerel commented