Replace inline css with suitable classes

Bug #379084 reported by Rocky Road
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
UD Theme
Fix Released
Low
Michael Lustfield

Bug Description

Going on with investigations started for bug #369912 , I found that the css
properties defined in lines 1167-1212 of style.css where mostly
overriden with inline css, more exactly in-html-head-style block,
generated by the function ubuntudrupal_columnsheets($left, $right) in
template.php.

Moreover, it appeared that the function
  phptemplate_body_class($left, $right, $header = '', $footer = '', $var_show_blocks)

was NOT USED.

In the default and most popular drupal core themes, garland, this function is
precisely used to allow defining different css rules according to the
presence or absence of left and right sidebar contents.

So here it is. This patch is supposed to change the organisation of
css rules, while not changing them, i.e.
_you shouldn't see any difference in your browser_
after applying the patch.
If you do this is the place to report it.

I think that the rules contents is a different bug, but far better
fixed after making this structural change.

I first created a small script, columns-css.php , to generate
pseudo-dynamic styles. I included it in the patch for completeness, but
there's no reason to distribute it, and next patch will remove it.

It is intended to generate styles strictly equivalent
to those previously inserted dynamically in html page header.

I simply added a context class, to be inserted, dynamically this time, to <body>
The result shows that invalid or nonsense css is output if no sidebar is activated.
However, to keep the resulting layout strictly equivalent, I inserted everything in
style.css, after the settings that previous version was overriding.

I removed the function and the call from
In template.php, I removed ubuntudrupal_columnsheets() and its
invocation, and rewrote phptemplate_body_class()
which builds a class attribute reflecting the presence of sidebars.

It returns a string of the form " class=\"$class\"" , where $class is one of:
       - 'with-both-sidebars'
       - 'with-sidebar-left'
       - 'with-sidebar-right'
       - 'with-no-sidebar'

This result is inserted in the <body> start tag, in page.tpl.php

This patch has not been thouroughly tested, but, as the length of this
report lets imagine ;) , it has been carefully thought *before* writing.

Revision history for this message
Rocky Road (m-baert) wrote :
Revision history for this message
Rocky Road (m-baert) wrote :

Ooops, a small error in rules generation. Sorry.

Revision history for this message
Rocky Road (m-baert) wrote :

The extra file was not included as I thought. Here it is.

Changed in ubuntu-drupal-theme:
assignee: nobody → Rocky Road (m-baert)
importance: Undecided → Low
status: New → Triaged
Rocky Road (m-baert)
Changed in ubuntu-drupal-theme:
status: Triaged → Fix Committed
Revision history for this message
Rocky Road (m-baert) wrote :

To start actually fixing layout , appy the patch, then see bug #379205

Revision history for this message
Michael Lustfield (michaellustfield) wrote :

This bug was improperly marked as fix committed. The patches was not committed to the source nor were they tested enough to be committed.

However, I have pushed a fix to this issue in r97.

Changed in ubuntu-drupal-theme:
assignee: Rocky Road (m-baert) → Michael Lustfield (mtecknology)
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.