In summary... new regions where created.

This came out from the need to manage bigger/complex forms, without the need to work at template level.
The ease of use of drag & drop in this module makes editing forms a breeze.

Big thanks for the author.

Here are the areas of change:

1) nodeformcols.module
2) css/nodeformcols.css

See Attachment for overview of final result.


function nodeformcols_form_regions() {
  return array(
	'header' => t('Header Column'),
	'main' => t('Main column'),
	'right' => t('Right'),

	'header2' => t('2nd Header Column'),
	'main2' => t('2nd Main column'),
	'right2' => t('2nd Right'),

	'header3' => t('3rd Header Column'),
	'main3' => t('3rd Main column'),
	'right3' => t('3rd Right'),

	'header4' => t('4th Header Column'),
	'main4' => t('4th Main column'),
	'right4' => t('4th Right'),

	'footer' => t('Footer'),

  );
}

...
...
...
...
...
...

 // Ensure that we have the footer wrapper so that
  // we clear the floating columns
  if (!$has_elements['footer'] || !$has_elements['header2'] || !$has_elements['header3'] || !$has_elements['header4'] ) {
   
    $has_elements['footer']  = TRUE;
	$has_elements['header2'] = TRUE;
	$has_elements['header3'] = TRUE;
    
	$regions['footer'][] = array(
      '#type' => 'markup',
      '#value' => '<div class=aux-clearer></div>',
    );
	
	$regions['header2'][] = array(
      '#type' => 'markup',
       '#value' => '<div class=aux-clearer></div>',
    );
	
	$regions['header3'][] = array(
      '#type' => 'markup',
       '#value' => '<div class=aux-clearer></div>',
    );
	
	$regions['header4'][] = array(
      '#type' => 'markup',
       '#value' => '<div class=aux-clearer></div>',
    );	
  }

And here is the css

/* $Id: nodeformcols.css,v 1.2 2009/03/04 20:14:55 hugowetterberg Exp $ */

.node-form-has-region-header .form-region-header {
clear: both;
}
.node-form-has-region-main .form-region-main {
float: left;
width: 49%;
}
.node-form-has-region-right .form-region-right {
width: 49%;
float: right;
}
/*====================================================*/
.node-form-has-region-header2 .form-region-header2 {
clear: both;
content: ".";
}
.node-form-has-region-main2 .form-region-main2 {
float: left;
width: 49%;
}
.node-form-has-region-right2 .form-region-right2 {
width: 49%;
float: right;
}
/*====================================================*/
.node-form-has-region-header3 .form-region-header3 {
clear: both;
}
.node-form-has-region-main3 .form-region-main3 {
float: left;
width: 49%;
}
.node-form-has-region-right3 .form-region-right3 {
width: 49%;
float: right;
}
/*====================================================*/
.node-form-has-region-footer .form-region-footer {
clear: both;
}
.aux-clearer{clear: both;}

CommentFileSizeAuthor
#2 sample-form.JPG75.06 KBbakr
regions.JPG111.66 KBbakr
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

bakr’s picture

Please note, that I had to add a new class "aux-clearer".

This was essential to overcome IE css rendering issues.

With All Best Regards

bakr’s picture

Title: I have Extended the Node Columns » New Extended Layour for Drupal Forms
FileSize
75.06 KB

This is a working sample snapshot from my site.

And sorry, I just realized I forgot to include the css for the fourth regions..

here it is, just append the above with the following:

/*====================================================*/
.node-form-has-region-header4 .form-region-header4 {
clear: both;
}
.node-form-has-region-main4 .form-region-main4 {
float: left;
width: 49%;
}
.node-form-has-region-right4 .form-region-right4 {
width: 49%;
float: right;
}

bakr’s picture

The following css should be addedd to ie7 fix file.

Note: you may change the width depending upon suitability with your theme.

.form-region-main, .form-region-main2, .form-region-main3, .form-region-main4, 

.form-region-right, .form-region-right2, .form-region-right3, .form-region-right4 

{
	
	width: 465px !important;
	
}
AntiNSA’s picture

Can someone roll this into a patch or update the dev version with this fix?

okday’s picture

Yes, It must be added to the dev version

thanks.

GreyHawk’s picture

Bakr -- I think you also left out a PHP line, tho take it with a grain of salt as I'm still learning...

Here:

// Ensure that we have the footer wrapper so that
// we clear the floating columns
if (!$has_elements['footer'] || !$has_elements['header2'] || !$has_elements['header3'] || !$has_elements['header4'] ) {

$has_elements['footer'] = TRUE;
$has_elements['header2'] = TRUE;
$has_elements['header3'] = TRUE;

$regions['footer'][] = array(

Shouldn't that be this?

// Ensure that we have the footer wrapper so that
// we clear the floating columns
if (!$has_elements['footer'] || !$has_elements['header2'] || !$has_elements['header3'] || !$has_elements['header4'] ) {

$has_elements['footer'] = TRUE;
$has_elements['header2'] = TRUE;
$has_elements['header3'] = TRUE;
$has_elements['header4'] = TRUE;

$regions['footer'][] = array(

I don't know if it'll throw an error or not, but looks like "header4" might be needed there...

AntiNSA’s picture

where is that patch?

bakr’s picture

As for "Header4", you are right, actually the regions.jpg was a theoretical draft.

As what we care about is simply a div that is cleared from both.

So, name it as you wish, you can add more, but make sure it is consistent and has a CSS equivalent markup.

As for the patches, I do not know use any diff tool. maybe someone could help here.

Regards

Skirr’s picture

really musthave extention

itserich’s picture

This might be a good addition to D7.

asherry’s picture

Status: Active » Closed (won't fix)

Updating all 6.x tickets as they are no longer supported. Feel free to re-open, I will commit any needed patches still.