Last updated June 5, 2013. Created by LeeHunter on April 18, 2010.
Edited by wildflower_0002, eli-f, arianek, pianodavid. Log in to edit this page.

These steps outline how to alter the way Drupal 7 renders fields to HTML. Changing the order can satisfy requirements you have for how your content is displayed. It can also make styling the content with CSS much simpler and more direct.

Default display

  1. Navigate to the Content types page (Administer > Structure > Content types).
  2. In the table, locate the row that contains your content type and click the manage display link.
  3. Specify the default label position and format.
  4. Click Save.

Custom display settings

  1. Navigate to the Content types page (Administer > Structure > Content types).
  2. In the table, locate the row that contains your content type and click the manage display link.
  3. In the Custom display settings section on the Default display settings, add custom display settings for Full content, Teaser, RSS, Search index and Search result.
  4. Click Save.
  5. The selected view modes (Teaser, RSS etc.) will show up as links.
  6. Click on one of the view modes, e.g. Teaser, to specify the label position and format for that view mode.
  7. Click Save.

Looking for support? Visit the Drupal.org forums, or join #drupal-support in IRC.

Comments

How exactly do I set the teaser length to 'unlimited' in Drupal 7? In Drupal 6 I use the module 'Teaser by content type'. I understand this feature is now in Drupal core but I cannot find the setting in Drupal 7 beta. Is it there?

In Drupal 7 just change the length limit from 600 to unlimited ( write the word unlimited). It will take effect in future posts. Any prior post would have to be edited and re saved in order for the new length to take effect.

"never quit - seek love, new artistic forms, new possibilities" - Camões

I entered 'unlimited' into the field and saved the settings but that didn't work. I tried 99999 and that didn't work either. What did work was changing the limit to 9999.

change format to "default" and it wont try to trim at all

Is it possible to create additional display settings (view modes) - e.g. "teaser2"?

I also want the same functionality.
Did you get through this?

You can add extra display modes using hook_entity_info_alter.

Say you have a custom module 'myModule' and want to add a custom view to the node entity:

<?php
function myModule_entity_info_alter(&$entity_info) {
   
$entity_info['node']['view modes']['mymode'] = array('label' => 'My Custom Mode', 'custom settings' => 'TRUE');
}
?>

Flush caches and this should show up as a customisable view mode on the 'manage display' page of any node content type.

See also the entity view mode module.

Is there any way to replace, change or edit the "." that a teaser places in the end?
I've been searching anywhere, but I'm just not good with php code...

Bruno Mateus

My answer applies to Drupal 7: As far as a "." being the last character, it depends on how many characters you allow for an automatic Teaser. From the experiments I did, sometimes it ended on a "." and other times it didn't.

To change the number of characters allowed on an automatic teaser for an "article" go to Structure - Content types - Edit - Manage Display - Teaser - edit Trim Length to a different size other than the default 600.

If you are more specific perhaps someone can answer your specific question because I'm afraid my answer is not what you were looking for.

"never quit - seek love, new artistic forms, new possibilities" - Camões

Structure->Content types->(Basic Page) Manage Display->CUSTOM DISPLAY SETTINGS uncheck "Teaser"

Thanks for this.
I have just discovered that I need to have the module 'Field UI' enabled in order to see the 'Manage Display' options.

Now I would like to know how, with Teasers removed, I can stop both the 'trimmed' and 'full' versions being shown in Preview when editing. Any suggestions?

permissions.. some view.. or other..
enabled 'field ui' and I can see the tabs to manage the fields.. simple. but frustrating..
thanks for this post

''The secret though is just keep walking through life without analyzing it too much or clinging to it too much. Just walk on.'' - Marilyn Silverstone, Magnum Photographer & Buddhist Nun, b. March 9, 1929, October 1999.

This works fine, thanks!
I should note that unless you are customizing a site for someone else that wants to remove the Teaser, I would not remove it because it allows for greater flexibility.

Usually and since I rarely use the Teaser on my own personal sites, I post a copy of the whole article in the teaser window so it displays everything.

The reason why I don't remove the Teaser option is because sometimes I want to customize my writing on the front page and write it differently on the "read more" page. I can also place a different photo on the front page and when the reader click on the text link, it shows a more detailed article or a more appropriate photo for the space the full article facilitates. The teaser allows for two different ways of writing the same article -- one for the front page and one for the 'Read more' page.

In other words, if I can keep the Teaser as an option, I always keep it.

( You can also replace the original length of 600 characters to unlimited (just write unlimited)and it will will always post the totality of your article unless you override it. It only takes effect on future posts, so you may have to edit past posts if you want to change their teaser length to the new unlimited limit.)

"never quit - seek love, new artistic forms, new possibilities" - Camões

I've noticed an odd behaviour with Drupal 7 custom fields that I'd appreciate some help with.

I created a new content type, and added two custom fields, let's call them: field_logo (img type) and field_homepage (link type using the link module)

I have installed the CCK Blocks module, so these fields are available as blocks, as I'd like them to appear at the side of the main content. I set these fields to hidden for Default, Full Content and Teaser views, but when I use the blocks admin to create these fields as blocks, they also appear in the Full Content Field area, which means each one appears twice on the page,

Does anyone have any idea what might be causing this, and how I can get around it?

Thanks for any help.

Did you ever find out what was causing this? I'm having exactly the same problem.

In case anybody else happens upon this, it is actually an issue with CCK Blocks. See http://drupal.org/node/833730 for details.

Don't know if this is a solution for you but take a quick look at step 6 on the cck block instruction page. It might be related to your problem.
http://drupal.org/project/cck_blocks

Tony

"never quit - seek love, new artistic forms, new possibilities" - Camões

When Search index and search result displays settings are used ???

It looks like the Search Results settings are to flag whether a field is visible in the search results. For now, the only field I can get to actually show in the results is the Body. None of my added fields will show in the results.

I'm not sure what the Search Index settings are for. My thought is that the fields would show on the Advanced Search page, but this isn't happening for me.

Aye, same issue here - search results cant be themed with the available display field types in D7. Same issue is reported here, but not solved atm:
http://drupal.org/node/1166114

I am looking at two different D7 sites with diverse settings, one simple and one more complex. Both fail to display any custom settings for Search Results. Both successfully display custom settings for Teaser.

It seems there's a basic switch not turned on somewhere here.

--
Tom/* Ogden

Select Search index. Save. Whatever field you drag then into the visible part will be indexed. This is useful since you sometimes have fields that should not be searchable, and sometimes fields are hidden in Full content although they still generate some content that should be included in searches.
Remember indexing is done by cron. If you want instant indexing, there's a module that I forgot the name of. Search for it and hope for it having been indexed on this site.
Search result is the view mode for displaying your chosen fields in the search results.

Wie buchstabiert man Blindtext in Braille?

How would you rearrange the node title such that it is displayed below a body or an image?

Could you be more specific? Thanks!

"never quit - seek love, new artistic forms, new possibilities" - Camões

I miss this option too. He meant rearrange to something like:
1 - image
2 - title
3 - body

Instead of have title always on top. Cant find it also.

I've got a taxonomy term and added a custom field to it. The custom field is an image and called "field_insignia". What do I need to put in my theme template for it to show up?

I've tried:

<?php print render($user_profile['field_insignia']; ?>

But no luck...

A great tip here is to use Display Suite for D7. Makes using the new UI for displaying fields even better.

http://drupal.org/project/ds

The Custom Display Settings option for the Body field is Not Selectable in my Drupal 7 installation. Does anyone know how I can make it be selectable? Is there a way to Reset?

I'm unable to select the Custom Display Settings on any of my content types. I see the option under Manage Display, but the option isn't clickable, like the function has been disabled. Has anyone else had this issue? Is there a setting somewhere that I'm missing?

Did you ever resolve this issue - I have the same problem.

I think jQuery update is the problem I reverted to using 1.3 instead of 1.7 and everything started working again.

It seems that there is no theme specific display options? Just when you need 'em

I added a couple of fields to my content types that allow for multiple values. When I display the content using a view, I see the option for using a comma separator, but not when managing the display for the content page.

How do I do that?

I can add a field to a product, I can see and use that field when editing a product page, I can see the field while in the edit page and hitting "preview" - yet the new field never shows when I just view the page normally. What am I doing wrong?

Hi,

I'm trying to solve the following issue, I have created a custom content type where users shall be able to upload one to many files. I want to display the files with a specific viewer within that content, which I have configured successfully. I also want the content to simultaneously display a table or multiple links to the uploaded files (which I have been able to very easily configure successfully). I have not manage to figure out how to add multiple displays for a single "Field", which could allow me to do this.

Does anyone have suggestions on how I could display these two things at the same time?

Thank you for your help!
Mikael

Have a look at the custom formatters modules https://drupal.org/project/custom_formatters

Hi, was there a specific formatter that you recommended or can this be used to display a single uploaded file in multiple different displays at the same time?
If I want to display the content in this viewer https://drupal.org/project/v3dm and as a direct url to the file, I'm not sure how this could be solved with this..

No its it not a predefined formatter the point with this module is you effectively write your own formatter code which you can do with PHP or with tokens.

I don't know anything about the module you're so you'll have to work out how that is themeing your data but assuming for a moment it uses a theme function then you do something like:

<?php
  $data
= $variables['#items'][0]['uri'];
 
$output = theme('THEME FUNCTION CALL');
 
$output .= "<a href="'.file_create_url($data).'">DOWNLOAD ME</a>";
  return
$output;
?>

The other alternative is to create a theme file for the field. Have a look here: https://api.drupal.org/api/drupal/modules!field!theme!field.tpl.php/7

Actually now I think about it you could probably do this with a custom block too. If you have a look I'm using this principle on this site.here: http://www.jesus.org.uk/books/fire-our-hearts

My block code looks like this (albeit a drupal 6 site)

<?php
if(arg(0) == 'node' && is_numeric(arg(1))){
$node = node_load(arg(1));
print
l(theme('imagecache', 'book_thumbnail', $node->field_book_thumb[0]['filepath'], '', '', array('class' => 'image-left')). 'Read <strong>'.$node->title.'</strong> online now in a virtual book', $node->field_book_upload[0]['filepath'], array('html'=>true, 'attributes'=>array('class'=>'read-book clearfix')));
print
'<div class="color5 feature-box">'.l('Read online now<br/>as virtual book', file_force_create_url($node->field_book_upload[0]['filepath']), array('html'=>true,'attributes'=>array('class'=>'virtual-book'), 'query' => array('download' => '1'))).'</div>';
print
'<div class="color4 feature-box">'.l('Download<br/>as a PDF', file_force_create_url($node->field_book_upload[0]['filepath']), array('html'=>true,'attributes'=>array('class'=>'pdf-download issuu-link-hijacked'), 'query' => array('download' => '1'))).'</div>';
if (
is_array($node->field_download_version) && !empty($node->field_download_version[0])) {
    foreach (
$node->field_download_version as $file) {
      print
theme('file_force_file', $file);
    }
    print
'<br/>';
  }
}
if (!empty(
$node->field_buy_link[0]['url'])) {
  print
'<div class="color3 feature-box">'.l('Buy a copy<br/>from our shop', $node->field_buy_link[0]['url'], array('html'=>true,'attributes'=>array('class'=>'buy-book'))).'</div>';
}
?>

Essentially I'm using the same field a couple of times to generate a couple of different links

Hope that helps