I am using Danland 7. x.1.0 with Drupal 7.o together with Panels 7.x 3.0-alpha3.
I get "published by [username] on [date] [time]" at the head of each article and panel. How can I remove it.
Looking through the code I see that it is controlled by variable $display_submitted (node.tpl.php line 14):
<?php if ($display_submitted): ?>
<div class="meta submitted">
<?php print $user_picture; ?>
<?php
print t('published by !username on !datetime',
array('!username' => $name, '!datetime' => $date));
?>
</div>
<?php endif; ?>
I can see nowhere, either in this file or the whole of the Drupal folders where $display_submitted is either initialized or referenced!
I found an old messge relating to this subject which told the originator to change a setting in themes>global settings. However, that message related to Drupal 6 and I can see no settings in Drupal 7 relating to this, either in the Global settings or in the Danland specific settings!
How can I change it in Drupal 7 /Danland 7 so that 'Published By..' is not displayed?
Comments
Comment #1
danpros CreditAttribution: danpros commentedHi,
How if just removing this in node.tpl.php
Dan
Comment #2
Peters196 CreditAttribution: Peters196 commentedThat doesn't appear to work!
As an alternative to deleting it, is is possible to move 'Published By...' to below the body, rather than between the title and the body?
Is is possible, also, to reduce the ammount of white space (about four or five lines of it) above the body? (between the normal position of 'Published by..' and the body)
Comment #3
danpros CreditAttribution: danpros commentedHi,
I try to remove that in my PC and its work :) try to reload the page. You can move that by print this else where
Dan
Comment #4
dru.paul CreditAttribution: dru.paul commentedfor those using Drupal 7.2
changing 1st occurence of
$variables['display_submitted'] = TRUE;
to
$variables['display_submitted'] = FALSE;
in
drupal7/modules/node/node.module
as shown below works for me.
or if leave as TRUE can change what is printed by altering the
line.
Comment #5
rotarydial CreditAttribution: rotarydial commentedThanks, dru.pal. This worked for me. Question though... does it count as hacking core?
Comment #6
sboots CreditAttribution: sboots commentedSeconded - thanks dru.paul! Worked perfectly.
To rotarydial, nope, that doesn't count as hacking core! By pasting dru.paul's second code block into your theme's template.php file, I think you're using Drupal 7's theme system exactly as designed. It'll look something like,
If you'd like to use a different date format, you can use something like the example here: http://drupal.org/node/1072640#comment-4382014
All the best!
Comment #7
danpros CreditAttribution: danpros commentedHi,
What dru.paul did is hacking the Drupal core, and I am hacking the theme core, ups! :D
If you want re-order the placement than you can change it via node.tpl.php, using template.php is the best solutions if you want to change words, date system etc.
Dan
Comment #8
sboots CreditAttribution: sboots commentedAh, touché - thanks Dan! You're right. I only looked at the very last line of dru.paul's post. : ) Agreed - template.php seems to be the best place for these changes.
Cheers! : )
Comment #9
alesr CreditAttribution: alesr commentedTo disable "Submitted by ..." text in Drupal 7 for a custom content type, go to structure -> content types -> edit and in "Display settings" tab uncheck "Display author and date information" checkbox.
No need to write code for this.
Comment #10
danpros CreditAttribution: danpros commentedHi alesr,
Thanks for the hint, yes like on D6. The poster write a code so we all thinking if he want completely remove it :)
Comment #11
cord1 CreditAttribution: cord1 commentedInteresting discussion.
I am creating a module, creating a new contenttype which I populate with nodes in the *.install file.
Seems there is no possibility to set the publishing-, display-, comment- or menu-options before populating with nodes without "hacking" the core.
I think this should be a part of options like $node->comment, $node->promote and $node->sticky is.
If not you have to hack the core I think.
Or do anyone else know a another way?
This is moved to http://drupal.org/node/1277730
Comment #12
rob1pcs CreditAttribution: rob1pcs commentedUnless I don't understand the problem (I don't use Danland or panels), can you not just turn this off through the content type settings?
Comment #13
Peters196 CreditAttribution: Peters196 commentedWhen I first submitted this issue I was still feeling my way around Drupal and Danland.
In my case the 'mansge Display' settings in Content type has done what I needed, so, as far as I am concerned the issue is fixed!
However, some of the other posts to this topic seem to raise more complex issues which may (or may not) need more in-depth investigation. Could I suggest that if anyone still has an un-answered problem on their version of this issue that they submit it as a new issue.
Thanks to everyone who suggested possible solutions to my problem.
Peters196
Comment #14
abhinya CreditAttribution: abhinya commentedref: alesr
Structure>content type>"content type, ex: book">display settings> uncheck "Display author and date information. "
That's the best way to do it.
Many times code edits without fully understanding the consequences and relative changes could be a bit uncomfortable at a later stage of development.
Regards,
Abhi Kalyan
Comment #16
tax14 CreditAttribution: tax14 commentedRef alesr's comment on August 1, 2011 at 12:24pm
This works for custom content types as well as the default content types (Article and Basic page), at least in Drupal 7.
Comment #17
dianacastillo CreditAttribution: dianacastillo commentedin drupal 6 you do it here in the admin page ?q=admin/build/themes/settings you can disable these per content type
Comment #18
fazal_rkmp CreditAttribution: fazal_rkmp commentedin my site i have different admin for different region. who can approve the content in there own region.
Now my problem is i want to add Approved by "Admin Name" to the "Submitted by " line which is available below the title of every node.
Please tell me is it possible.
Comment #19
Yet Another User CreditAttribution: Yet Another User commented#9 Alesr's answer worked for me :)
Thanks +1
Comment #20
mmomin CreditAttribution: mmomin commentedHow can I display Author's position as well?? I meant "Blogger" or a "manager" etc..
Comment #21
MartinMa CreditAttribution: MartinMa as a volunteer commentedIt would be great to uncheck Display author and date information" on the different view modes pages ...