3

I'm using Drupal 7 with Omega subtheme and Display Suite module.

I have a content type and the nodes are displayed as default (Full Content). But I have two or three nodes of this content type which must be displayed in slightly different way (just a few fields hidden, some others perhaps).

So using Display Suite I've created a new view mode for these specific nodes and on the content edit page I've selected new view mode rather than Default.

Now the problem with this new mode is that node's title is rendered twice, once as the page title and second as the node title. This is different from the Default/Full Content mode, which seems to just have a page title and no node title.

How to get a rid of the node title on the new view mode so it's the same as the way Default/Full Content displays are shown (without using Views)?

Maybe there's some way to clone the Full Content view mode and then just edit that clone. So the new view mode also only shows a page title not the node title?

11

Since already using Display Suite you can enable Extras module in orde to hide page title

DS config
admin/structure/ds/extras

Tab "Other"
Check "Page title options"

Node Manage Display
admin/structure/types/manage/article/display/full

Tab "Layout for article full"
select Hide "Page title"

  • You'll need to ensure you're using the "Full content" view mode for this to work (you may not be by default). – danbohea Feb 11 '14 at 11:15
  • a vote up for display suite. – WaQaR Ali Sep 10 '15 at 9:36
2

sounds to me like a theming error. you probably have forgotten to check in the node.tpl.php if the node is being viewed or not.
regularly there is no title set

<?php if (!$page): ?>
  <h2<?php print $title_attributes; ?>>
    <a href="<?php print $node_url; ?>"><?php print $title; ?></a>
  </h2>
<?php endif; ?>

you can check for the $view_mode in the node template file and depending on that, set the titel (or dont set it). dont forget, that on the full view_mode, the page variable is set to true.

0

If anybody wants to solve this problem programmatically from template.php or a custom module:

/**
 * Implements template/hook_preprocess_node().
 */
function MYTEMPLATE/MYMODULE_preprocess_node(&$vars) {

  if ($vars['view_mode'] != 'full') {

    $vars['title'] = FALSE; // hides second title
  }
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.