1

I'm designing a web with Drupal and my theme is a subtheme of Omega 4. I'm using Context/Context Omega and Omega Layouts.

I have a node type("Product node", for example) that has a title field(like default node), a subtitle field called field_subtitle, and the rest of the content.

Since I need to use CSS just for the subtitle field, I need to put it in a div separately from the rest of the content. So I would like to print the title, like it does by default, print the subtitle, and print the rest of the content.

What I have made in my product-layout.tpl.php, searching for this kind of things is:

  <div id = "title">
      <?php print render($title_prefix); ?>
      <?php if ($title): ?>
      <h1><?php print $title; ?></h1>
      <?php endif; ?>
      <?php print render($title_suffix); ?>
      <?php print render($page['content']['field_subtitle']); ?>
  </div>
  <?php print render($page['content']); ?>

Or maybe changing the

<?php print render($page['content']['field_subtitle']); ?>

for

<?php print render($content['field_subtitle']); ?>

, but didn't got it to work. It doesn't give any error mistakes, but it doesn't separate field_subtitle from content, since if I remove the last line of this snippet, all content dissapear, even the subtitle. So... how can I print the subtitle in a separated way that the rest of the content? Am I doing something wrong?

Thanks

2
  • use node.tpl for node specific markup
    – Shabir A.
    Commented Nov 2, 2015 at 19:45
  • Thanks for the comment. At the end, I used the page.tpl, because I couldn't get variables declared in node.tpl, don't know why.
    – xecollons
    Commented Nov 4, 2015 at 9:22

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.