Hi

i have a node-content-type.tpl page enabled but It seems the page title is only part of the page.tpl file and not the node.tpl. So I cannot change the page title's style for a specific content type only for the overall pages of the site. Is there a way around this as I want to theme nodes of specific content types.

The body section is fine and I can target the css to change this it is the page title that is the problem.

Thanks in advance
Jimmel

Comments

kari.kaariainen’s picture

Does the theme you are using provide node type related classes in the body element? For instance Zen theme does. If yes, then you can target the title with .node-type-mynodetype h1.title.

Jimmel’s picture

Thanks for the reply.

No .node-type-mynodetype h1.title does not work.

I can target the title with .PostHeaderIcon-wrapper but it targets the whole site. The node content type is called product from the node-products.tpl.php page. Here is the code for that node file

<?php // $Id: node.tpl.php,v 1.3 2010/12/31 21:15:42 jimmyax Exp $ ?>
<div id="node-<?php print $node->nid; ?>" class="node<?php if ($sticky) { print ' sticky'; } ?><?php if (!$status) { print ' node-unpublished'; } ?> Post">
  <div class="product-body">
    <div class="product-inner">
      <?php if (!$page): ?>
        <h2 class="productHeaderIcon-wrapper"><span class="productHeader"><a href="<?php echo $node_url; ?>" title="<?php echo $title; ?>"><?php echo $title; ?></a></span></h2>
      <?php endif; ?>
      <?php if ($submitted): ?>
      <div class="productMetadataHeader">
        <div class="productHeaderIcons metadata-icons">
          <?php echo art_submitted_worker($submitted, $date, $name); ?>
        </div>
      </div>
      <?php endif; ?>
      <div class="productContent">
        <div class="productarticle">
          <?php echo $content; ?>
          <?php if (isset($node->links['node_read_more'])) echo '<div class="read_more">' . get_html_link_output($node->links['node_read_more']) . '</div>'; ?>
        </div>
      </div>
      <div class="cleared"></div>
      <?php ob_start(); ?>
      <?php $metadataContent = ob_get_clean(); ?>
      <?php if (trim($metadataContent) != ''): ?>
      <div class="PostMetadataFooter">
        <div class="PostMetadataFooter">
          <?php echo $metadataContent; ?>
        </div>
      </div>
      <?php endif; ?>
    </div>
  </div>
</div>

the .productHeaderIcon-wrapper
class is in there but that does not seem to target the title on the page.

Is there a way to override the sites title for specific content types using something like
.product-body .productHeaderIcon-wrapper

I cant seem to see the right combination and it could be something simple.

Cheers

kari.kaariainen’s picture

You should be able to print the $type variable to some suitable spot, for example in the first div, same way the $sticky and $status are printed in this theme, just mind the spaces. Then you could target the title, which seems to be h2, not h1, with .mytype h2.

Status: Active » Closed (outdated)

Automatically closed because Drupal 6 is no longer supported. If the issue verifiably applies to later versions, please reopen with details and update the version.