Hello.

I haven't built web pages since back when CSS was just catching on, so please be gentle on this newb!

I'm trying to add three new regions (taken directly from the Sandium theme
) to Arthemia, and I have *partially* succeeded. The regions, Top Left, Top Middle and Top Right, show up on the blocks page, and I'm able to add and see content; however, the regions do NOT appear on any other page.

I suspect that this is related to php, but I just can't figure it out.

Here's a section of the altered php code I've got going on for page.tpl.php:

 <?php if ($featured): ?>
          <div id="featured">
            <?php print $featured; ?>
          </div>
        <?php endif; ?>
      </div>
     	   <div class="clear"></div>
        <?php if ($top_left || $top_middle || $top_right): ?>
     	  <div id="content-top-container">
          <div id="top-left"><?php print $top_left ?></div>
          <div id="top-middle"><?php print $top_middle ?></div>
          <div id="top-right"><?php print $top_right ?></div>
          <div class="clear"></div>
        <?php endif; ?>
		</div>
		
		<?php endif; ?>
		   <div class="clear"></div>
            <?php if ($middle):?>
        <div id="middle" class="clearfloat">
          <?php print $middle; ?>
        </div>
      <?php endif; ?>

Here are the two respective, unaltered template.php for Arthemia and Sandium that I believe I have to somehow merge into Arthemia only:

Arthemia --

function arthemia_body_class($sidebar_primary, $sidebar_secondary) {
  if ($sidebar_primary != '' && $sidebar_secondary != '') {
    $class = 'with-sidebars';
  }
  else {
    if ($sidebar_primary != '') {
      $class = 'with-sidebar-primary';
    }
    elseif ($sidebar_secondary != '') {
      $class = 'with-sidebar-secondary';
    }
    else {
      $class = 'no-sidebars';
    }
  }
  return $class;

}

Sandium --

function phptemplate_body_classes($top_left, $top_right, $top_center) {
  if ($top_left != '' && $top_right != '' && $top_center != '') {
    $class = 'sidebars';
  }
  else {
    if ($top_left != '') {
      $class = 'sidebar-left';
    }
    if ($top_right != '') {
      $class = 'sidebar-right';
    }
    if ($top_center != '') {
      $class = 'sidebar-center';
    }
  }

  if (isset($class)) {
    print ' class="'. $class .'"';
  }
}

I would truly appreciate any help with this I can get!

Thanks!

Comments

NaheemSays’s picture

First, some simple questions: Have you cleared the cache and added content to those regions? If they are showing on the blocks page and not on others, it could be that you have not placed any content in them regions?

Just an additional note too, in there you have an empty div: <div class="clear"></div> - you can remove this and addclass="clearfloat" after div id="content-top-container"

changeitup’s picture

Thanks for responding!

Yes, I have cleared the cache (even though I have caching disabled).

I have indeed placed content in the regions, and the content appears only on the blocks page.

Thanks for the note on the empty div.

Any ideas?

changeitup’s picture

Assigned: changeitup » Unassigned
NaheemSays’s picture

Just having a look a that code.. staring at it and i cannot see anything obviously wrong with it.

Did you also edit the template.php or did you leave it as is?

changeitup’s picture

Bummer. Thanks for looking at it.

I haven't edited the template.php yet. My intuition (a.k.a my newbish, non-understanding of php) is pointing me toward merging the two sections of template.php code mentioned above, but my trial-and-error attempts have yielded no positive result.

I really hope we can figure this out...it would be the perfect solution for the non-profit website I'm building.

Thanks again for your help.

NaheemSays’s picture

Those two sections of template.php are about adding css classes to regions and do not affect the regions themselves.

changeitup’s picture

Okay, last question, and I will let it go.... : ) I really am appreciative of your help on this.

I've now found that the three regions will appear when there is content in the headline region as well.

I hope this is a clue as to what is wrong with the code.

NaheemSays’s picture

aah, yes.

It seems that you have added the new regions within the if ($headline) (or whatever it is called in the code) section. You need to break it out to be after the <? endif ?> for that.

(I notice tht some of the coding advice posted in #1 is a problem with the current theme as downloaded from here. I will look into fixing such stuff if/when I make other changes and updates to the theme.)