In working on a new site, I needed a more flexible panel layout than any of the existing ones. So, I wrote an extension to the existing "two column stacked" layout that I'm currently calling "two column stacked double", since it's sort of a double-decker version of it. ;) See the attached icon for details. This all seems to work just fine for me when I put these 3 files in my panels/layouts directory.

A) Anyone else think this layout could be useful to them?

B) Earl, any chance of committing this upstream to the main panels distribution?

C) If not, where should I put this code? ;)

Thanks,
-Derek

Comments

dww’s picture

Title: Add a new layout: "Two column stacked double" » Add a new layout: "Two column bricks"
StatusFileSize
new1.7 KB
new704 bytes
new277 bytes

Based on feedback in IRC from merlin and yoroy, I'm renaming this "2 column bricks", since that's sort of what it looks like: masonry work. ;)

dww’s picture

StatusFileSize
new1.69 KB

Whoops, left the wrong description in the .inc file.

dww’s picture

StatusFileSize
new99.51 KB

I don't understand why the spacing seems funny on the "content" tab when using my new layout. See attached screenshot. Any panels experts can tell me what I'm doing wrong, if anything? Notice there's no space between the "Middle" region, and the "Left below" and "Right below" regions. Thanks.

yoroy’s picture

Right on :)
+1, I think it would make a usefull addition. Nice starting point for a sections overview or portal-y page.

dww’s picture

StatusFileSize
new1.69 KB
new753 bytes

Ok, I fixed up the uneven spacing issues. Here's the (hopefully RTBC) final versions of the .css and .inc. The .png is unchanged from #1.

yoroy’s picture

Status: Needs review » Reviewed & tested by the community

Confirming spacing fixes. Adding the files to panels module folder simply worked. May I set this to RTBC? We'll see. :-)

kinter’s picture

I am new to drupal and unsure how to install this patch on my site. I do not have access to shell but do have access to cpanel. I tried to install the files directly to the panels module folder as was suggested but had no success. Is there another folder I need to install the files to?

merlinofchaos’s picture

You need to drop the inc, png and css files into the layouts directory; be sure to remove the _.txt extensions, as those are only put there to defeat the extension checker on the issue manager.

kinter’s picture

Thanks for the help. I did as you suggested but now receive the following errors when I click on the two column bricks layout:

• warning: array_keys() [function.array-keys]: The first argument should be an array in /home/mysite/public_html/test/sites/all/modules/panels/panels.module on line 314.
• warning: array_shift() [function.array-shift]: The argument should be an array in /home/mysite/public_html/test/sites/all/modules/panels/panels.module on line 315.
• warning: Invalid argument supplied for foreach() in /home/myssite/public_html/test/sites/all/modules/panels/panels.module on line 413.
• warning: Invalid argument supplied for foreach() in /home/mysite/public_html/test/sites/all/modules/panels/panels.module on line 524.

Any idea on what is causing this?

merlinofchaos’s picture

Status: Reviewed & tested by the community » Fixed

Fixed. BTW, note that if you just want to have your own layouts, hook_panels_layouts() should work to embed layouts in a module very nicely. The .inc files are a convenience for the code, but not actually required.

dww’s picture

Yay, thanks, Earl. ;)

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.