I am trying in Drupal6 to modify the .standart theme Bluemarine. I copied the folder to sites/all/themes as Newmarine. I want in the header line to separate the logo and the sitename and centralise the logo above the left sidebar.

The page.tpl.php defines three tables for header, content, and footer. The header table consists of one <tr> withtwo <td>'s, the first holding $logo and $site_name, the second holding $secondary_links and $primary_links. I defined one more <td> and moved $site_name into that <td> so that the first <td> only holds $logo. I further modified the tables so that header and content is in the same table. The purpose is to get the <td> with $logo aligned with the <td> that includes the left sidebar. And that works fine. But I cannot centralise the $logo in its <td>.

Here are the relevant lines of code as modified:

<table border="0" cellpadding="0" cellspacing="0" id="header">
  <tr>
    <td id="logo">
    <?php if ($logo) { ?><a href="<?php print $front_page ?>" title="<?php print t('Home') ?>"><img src="<?php print $logo ?>" alt="<?php print t('Home') ?>" /></a><?php } ?>
    </td>
    <td id="logo2"> 
      <?php if ($site_name) { ?><h1 class='site-name'><a href="<?php print $front_page ?>" title="<?php print t('Home') ?>"><?php print $site_name ?></a></h1><?php } ?>
      <?php if ($site_slogan) { ?><div class='site-slogan'><?php print $site_slogan ?></div><?php } ?>
    </td>
    <td id="menu">
      <?php if (isset($secondary_links)) { ?><?php print theme('links', $secondary_links, array('class' => 'links', 'id' => 'subnavlist')) ?><?php } ?>
      <?php if (isset($primary_links)) { ?><?php print theme('links', $primary_links, array('class' => 'links', 'id' => 'navlist')) ?><?php } ?>
      <?php print $search_box ?>
    </td>
  </tr>
//</table>

//<table border="0" cellpadding="0" cellspacing="0" id="content">
  <tr>
    <?php if ($left) { ?><td id="sidebar-left">
      <?php print $left ?>
    </td><?php } ?>

o.s.v.

I have tried in style.css for #logo to insert text-align:center, and I have tried to style the <td>, the <a>, and the <img> as text-align:center, and I have tried with display:block and a number of other tricks, but the displayed position of the $logo does not change. It stays aligned left.

How should I modify the code to get $logo aligned central in its <td>?

Comments

christian_belgien’s picture

Det gik galt med min post. Jeg proever uden kodeeksemplet og haaber det bliver forstaaeligt.

I am trying in Drupal6 to modify the .standart theme Bluemarine. I copied the folder to sites/all/themes as Newmarine. I want in the header line to separate the logo and the sitename and centralise the logo above the left sidebar.

The page.tpl.php defines three tables for header, content, and footer. The header table consists of one

withtwo 's, the first holding $logo and $site_name, the second holding $secondary_links and $primary_links. I defined one more and moved $site_name into that so that the first only holds $logo. I further modified the tables so that header and content is in the same table. The purpose is to get the with $logo aligned with the that includes the left sidebar. And that works fine. But I cannot centralise the $logo in its .

I have tried in style.css for #logo to insert text-align:center, and I have tried to style the

, the , and the Only local images are allowed. as text-align:center, and I have tried with display:block and a number of other tricks, but the displayed position of the $logo does not change. It stays aligned left.

How should I modify the code to get $logo aligned central in its

?
WorldFallz’s picture

in the future please be sure to properly enclose and code and html tags with <code>. Thanks.

christian_belgien’s picture

Thank you for help in formatting my question. I did not know the tag. I now do.

I am now hoping for help to solve my problem, to control the position of the logo. As explained, I have tried all of the ways in which I normally position images in containers, but to no avail. Could there be some Drupal-specific controls I must find and use?

WorldFallz’s picture

Sorry... i haven't used tables for layout in years, I don't even remember how any more, lol. I recommend you select a different-- non table based theme (also, blue marine was removed from core with d7).

christian_belgien’s picture

I figured it out - in addition to the css file defining a style for #logo it somewhere else defined a stile for #logo .img which placed img with float=left. When I removed this everything fell into place.
Thank you for being a sounding board. Frequently having to formally explain a problem can be a help towards solving it.

WorldFallz’s picture

lol -- i didn't actually do anything but I know what you mean. glad you figured it out.