3

When viewing a node, I'd like the Title to display below one of the other fields in the Content Type, but it's not available to arrange in the Manage Display tab.

With all of the flexibility and power that Drupal gives me, do I really need to create a custom template for each of my content types? :(

Any help is appreciated!

1

5 Answers 5

4

You can do this in Panels.

First, remove the print title statement from page.tpl.php in your theme.

Usually it looks something like this:

      <?php if ($title): ?>
            <h1 id="page-title"><?php print $title; ?></h1>
          <?php endif; ?>

This will prevent Drupal from printing the title automatically.

Then open up Panels and activate (if you haven't already) the node override template and the user override template as well as any other places where you need to display the title.

Then add the title where you want it to appear from within the Panels interface (Add content -> Page elements -> Page title).

2
  • This worked wonderfully, thank you. (and along the way it helped me understand how I should set up the other pages on my site. Thank you very much!) Commented Jun 5, 2012 at 15:39
  • 1
    Or with Display Suite.
    – Kevin
    Commented Mar 31, 2014 at 9:05
4

I agree the Title module is a great solution for many use cases. The Title module converts node titles to the field API in order to make nodes fully translatable. This has the effect of adding the title field to the manage display UI and they can be managed like any other field. In many cases this is much better than using template overrides or installing a much heavier module such as Display suite or Panels just to manage node titles. The Title module can be configured to convert the title on all future bundles and existing title fields have a convert link next to them on their manage fields UI.

2

Page title is not displayed as one of the available elements on the Manage Display page.

To do that, you have to edit the node.tpl.php file. Here's a short overview of what you need to do:

  • Copy the default node.tpl.php file from modules/node/node.tpl.php to your theme directory.
  • Rename the file in your theme to node--YOUR-CONTENT-TYPE.tpl.php. This way changes you make in this file will be only reflected for this particular content type.
  • Open the node--YOUR-CONTENT-TYPE.tpl.php file and reorder the way elements are printed for your node.

Here are some guidelines for node--YOUR-CONTENT-TYPE.tpl.php:

  • To render a field use: <?php print render($content['field_your_field']); ?>
  • Make sure you always have the <?php print <?php print render($content); ?> ?> in your node.tpl.php file, as well as the <?php print render($title_prefix); ?> and <?php print render($title_suffix); ?>. They render additional output by other modules, e.g. Contextual links, etc.

To read more about this check the docs page for node.tpl.php and theming nodes by content type.

1
  • Glad it helped. I agree about awkwardness - it's not really intuitive. Commented Oct 18, 2015 at 15:58
1

Instead of using a module for this simple request, you can also just adapt your node.tpl template file, and print the field required before the title.

1
  • Because I don't want to have to edit multiple node type templates for every single drupal site I set up... and while I know this is the standard "simple" answer... for a site as powerful and complex as drupal, being unable to change this one obvious thing that people would want to change is just stupid. I've since started using DisplaySuite which allows me to do this dynamically and I'm very happy with not hacking my templates all the time. Commented Feb 23, 2013 at 17:08
0
admin/structure/types/manage/article/display

Please follow image to restructure, from manage display you can set the order of filed according to your requirement: (Please drag and drop fields to reorder )

enter image description here

Thanks!

4
  • 1
    This doesn't answer OP's question because you can't change the way title is displayed on the Manage Display page. Will get back shortly with an answer. Commented Oct 18, 2015 at 14:49
  • 1
    Yes thanks for clearing things, Please follow this answer to move title according to your requirements, hope this will help: drupal.stackexchange.com/questions/33152/… (Just trying to help :) )
    – jas
    Commented Oct 18, 2015 at 14:52
  • Sorry if my message came across too harsh, it wasn't my intention :) I just wrote it in a few seconds and submitted it. We're all here to help. Commented Oct 18, 2015 at 18:13
  • Np that all good, actually I haven't understood question clearly when I submitted my answer before but you corrected me and Thanks for your great and Detailed answer :)
    – jas
    Commented Oct 18, 2015 at 18:16

Your Answer

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

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