As I understand it, page.tpl.php is only made for 16 columns, right?

If I want 12 columns I'll have to recalculate all the grid-* to fit 12 columns?

Comments

farrington’s picture

Well, you are right... the deafult page.tpl.php is set to use 16 columns.
But you don't have to do that much of a work to "recalculate", it is built in to the CSS.

You only have to change one thing.

In the file page.tpl.php you find the line below (on line 16):

<div id="page" class="container-16 clear-block">

Just change it to:

<div id="page" class="container-12 clear-block">

And you have 12 columns grid.

Since there, in the file style/960.css is multiple sets of grid-* (until grid-11) and those are are identified by:

.container-16 .grid-*

.container-12 .grid-*

This means that grid-* that is a child of the container-16 has one set of properties, the same grid-* has another set of properties if its a child of container-12.

/marcus

AdrianB’s picture

So what you're saying is that I don't have to recalculate lines like:

<div id="search-box" class="grid-6 prefix-10"><?php print $search_box; ?></div>

or:

<div id="header-region" class="region <?php print ns('grid-14', $mission, 7); ?> clear-block">

farrington’s picture

I totally misunderstood you, I thought you meant in the CSS.

And then you are right:

Simple example:

The last one will with 12 columns place the div with id="d" at the beginning of a new row, but at the end of the first line using 16 columns.

Sorry that I misunderstood.

/marcus

AdrianB’s picture

I thought I was very clear when I put "page.tpl.php" in the issue title... ;)

I know how the 960 grid works, what I wanted was to confirm that the page.tpl.php (not the CSS!) was only written with a 16 column grid in mind. Those examples are only two of many lines that would need a recalculation if you want to work with a 12 column grid instead.

My suggestion is that the theme supplies an alternative page.tpl.php based on 12 columns.

(But I'm actually already given up on using the 960 grid for the moment (or any other grid like Bluetrip) because it wasn't flexible enough for what I'm working on right now. I do like the pixel instead of em choice by the creator of 960, em just doesn't work well on a complex system like Drupal with a lot of nested elements, you get a complete inheritance nightmare with themes like Bluetrip which uses an em based css framework.)

dvessel’s picture

Status: Active » Closed (works as designed)

The default template should only serve as an example. Most themes will have their own structure thus custom page.tpl.php file so having an alternative 12 column template doesn't seem useful.

One thing I've learned from working with 960 is that the burden is shifted into more important tasks. It's not for every situation or everyone but when it fits, it just works and more time can be spent on polish.

AdrianB’s picture

Ok, fair enough, if I would use this theme in the future I'll do it myself. I originally just wanted to know if that's was what I had to do, or if I just misunderstood the template file.

And yes, for the right kind of project I think it could be a time saver. Especially if you don't have a completed design to begin with and have the freedom to adjust to the limits of grid based design.

juan_g’s picture

For upcoming NineSixty 2.0:

"There will be 3 versions. 12, 16 or combined."

http://drupal.org/node/371137#comment-2096710

AdrianB’s picture

Nice!