Content + sidebar , oppure solo content

3 contenuti / 0 new
Ultimo contenuto
Content + sidebar , oppure solo content

Scusate la domanda sicuramente idiota,ma come devo impostare il css per avere un content che varia la propria larghezza in base alla visualizzazione o meno, della sidebar ?

Per ora sono arrivato qua:

#contenitore_content { width:800px;}
#content { width:auto; float: left;}
#sidebar_right { width:200px; float: right;}

Nel page.tpl.php:

<div id="contenitore_content"><?php if ($sidebar_right): ?><div id="sidebar-right"><?php print $sidebar_right ?></div><?php endif; ?>
<div id="content"><?php print $content ?></div></div>

In questo modo funziona con IE7 ..ma con Firefox (come al solito,du palle) il content viene visualizzato per esteso... mo cosa manca ?...

Ho risolto.. basandomi sul tema Framework ho scoperto che le funzioni che gestiscono le aree sono queste:

page.tpl
<?php print phptemplate_body_class($sidebar_left, $sidebar_right); ?>>

template.php

function phptemplate_body_class($sidebar_left, $sidebar_right) {
  if ($sidebar_left != '' && $sidebar_right != '') {
    $class = 'sidebars';
  }
  else {
    if ($sidebar_left != '') {
      $class = 'sidebar-left';
    }
    if ($sidebar_right != '') {
      $class = 'sidebar-right';
    }
  }
  if (isset($class)) {
    print ' class="'. $class .'"';
  }
}

Qualcuno potrà notare la mancanza della famosa function miotema_regions per aggiungere appunto le regions.. nn è un problema,basta inserire:

function miotema_regions() {
  return array(
    'cio che vuoi' => t('cio che vuoi),
    'quello che ti pare' => t('quello che ti pare')
  );
}

e procedere normalmente al theming del css e del page.tpl

Spero di essere stato di aiuto a qualcuno :D:D:D