Hi guys,
I'm new to drupal but quite proficient with html/css etc.

MY main content area is currently 1 column like the drupal default.

I'd like to split it into two such as on www.goingon.com
How do i go about doing that?

also

What did they edit to add the different blogs into those 2 columns.
When i add the news aggregatore to my main content area it goes 100% width of the content area, lets say i only wanted it to go 50% width,
how would i go about changeding its layout?

Thanks again,
Leeais

Comments

Chill35’s picture

The long way : by changing page.tpl.php in your theme's folder (if your theme relies on the phptemplate.engine).

The short way : by looking up that module, maybe ? http://drupal.org/project/panels

Caroline

bmango’s picture

You can split your main content into two columns by updating the node.tpl.php template. You could use (as a rough guide) the following code (you will need to replace the section in the node template for the div class="content" section with this code):

<div class="content">
	<?php
		$length=strlen($content);
		$length=ceil($length/2);
		$content1=substr($content,0,$length);
		$content2=substr($content,$length);
		?>
		<div class="content-col1">
    	<?php print $content1; ?>
		</div>
  	<div class="content-col2">
    	<?php print $content2; ?>
		</div>
</div>

You can then use css rules to style it as you like. I used:

.content-col1 {float:left; width:45%;}
.content-col2 {float:left; width:45%;}

Ben

s@ilor’s picture

Hello Ben,

I've stumbled over your 2-column trick here, and have a question:

My node.tpl ... looks like this:

<article<?php print $attributes; ?>>
  <?php print $user_picture; ?>
  
  <?php if (!$page && $title): ?>
  <header>
    <?php print render($title_prefix); ?>
    <h2<?php print $title_attributes; ?>><a href="<?php print $node_url ?>" title="<?php print $title ?>"><?php print $title ?></a></h2>
    <?php print render($title_suffix); ?>
  </header>
  <?php endif; ?>
  
  <?php if ($display_submitted): ?>
  <footer class="submitted"><?php print $date; ?> -- <?php print $name; ?></footer>
  <?php endif; ?>  
  
  <div<?php print $content_attributes; ?>>
    <?php
      // We hide the comments and links now so that we can render them later.
      hide($content['comments']);
      hide($content['links']);
      print render($content);
    ?>
  </div>
  
  <div class="clearfix">
    <?php if (!empty($content['links'])): ?>
      <nav class="links node-links clearfix"><?php print render($content['links']); ?></nav>
    <?php endif; ?>

    <?php print render($content['comments']); ?>
  </div>
</article>

I have been faffing a bit with it, but I'm not sure. Where would you recommend to add your code?

Cheers,
- Christian

-- Christian