Drupal Tutorials and Blog Posts

Drupal 6 and 7: Author and Date Information

April 22, 2011 | Written by Steve Burge

There was one small little feature in Drupal 6 that would routinely drive students in our classes mad. It wasn't a major feature but it was a major annoynance: controlling the author and date information. Some content on your site simply doesn't need to display the name of the author and the date the content was written.

Here's how to find the display settings in Drupal 6 and an explanation of how things have changed for the better in Drupal 7.

Author and Date Information in Drupal 6

The confusing things about these settings in Drupal 6 is that they aren't in any of the content areas. In fact, it's a content setting that's controlled by the theme.

To turn off the author and date information, go to Administer > Site building > Themes > Global setting > Display post information on. That's not exactly intuitive.

tutuploadsmedia_1303498012675.png

Author and Date Information in Drupal 7

tutuploadsmedia_1303496993470.png

In Drupal 7 the author and date settings have moved. To find them in Drupal 7, you need to look inside the Content types. To get there, click on Structure and then Content types. Then click edit next to the Content type you want to turn off author and date information for.

tutuploadsmedia_1303497024607.png

Scroll down to the bottom of the page and click on the Display settings tab. Here you can uncheck the box and turn off the author and date information.

Unfortunately you can't get any more specific than this. For example, you can't turn one on but leave the other off. You also can't turn these on and off for specific content items. To do that, you'll need to edit the theme files.

tutuploadsmedia_1303497059722.png


 

Comments  

 
#1 criscom 2011-06-20 14:26
Thanks for your tutorial. I have a special question.
I want to hide the author information and just display the time information.

instead of:
Submitted by criscom on Mon, 06/06/2011 - 11:44

i want:
Submitted on Mon, 06/06/2011 - 11:44

can you give me a hint on how to achieve this?

thanks.
chris
 
 
#2 kryptonite 2011-06-20 15:04
I also would like to know a solution for this problem!
 
 
#3 kryptonite 2011-06-20 15:22
I found it:

"How about if you want to display the date information but not the author information, e.g. you want to see something like:

Posted: February 23, 2011

To accomplish this,

1. Enable Display Settings for the corresponding content type.
2. Edit the node.tpl.php file of the corresponding theme you are using, e.g. themes\bartik\t emplates\node.tpl.php and located the following command:
print $submitted;

3. Now replace this command with the following code:
// print $submitted;
if ($submitted) {
echo "Posted: " . date( "F j, Y",$node->created);
}

4. Save the file and you should see the submitted information in the desired format. Of course, you can use a different date format or add additional node details."

full article here drupal.org/node/1072640
 
 
#4 Karla 2011-07-14 00:28
Thanks, couldn't for the life of me find out how to do this, but your post helped heaps!
 
 
#5 iowawebco 2011-07-14 13:04
You're welcome, Karla! :)

Kind regards,
Nick
 
 
#6 iowawebco 2011-07-14 13:04
Great job, Kryptonite!!

Kind regards,
Nick
 
 
#7 daniel 2011-11-30 23:46
Thank you very much sir :-)
 
 
#8 iowawebco 2011-12-02 03:05
You're very welcome, Daniel! There's a lot more available inside to members. Check out ostraining.com/.../#heading for everything that's available to you if you become a student at OSTraining.com

Kind regards,
Nick
 

Add comment