Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
The node author, and posting date/time don't show on front page in main content area... whether I use Story or some other content type doesn't seem to matter. Do I need to change a setting somewhere?
When I post content in the right sidebar, the author and posting info does appear, but it goes between the title and the content... is there a way to make it show after the content?
Comments
Comment #1
provod CreditAttribution: provod commentedsame thing - I configured "display post information" via admin-building-themes-global settings, but no results on the front page
Comment #2
aharown07 CreditAttribution: aharown07 commentedAnybody got a theory on this one? I can probably find somebody to look at php or css or whatever if I had any idea what file to look at.
Comment #3
Lioz CreditAttribution: Lioz commentedtake a look into the node template
int the homepage node are presented as teasers, so look into the if($teaser) condition and simply paste this code
Comment #4
aharown07 CreditAttribution: aharown07 commentedI don't actually "understand" PHP yet so.... can you give me a little more of the context so I can see better where to put it? ... or a line number?
Thanks!
Comment #5
aharown07 CreditAttribution: aharown07 commentedOK, I see several different
<?php if (!$teaser): ?>
places in the file... but only one<?php if ($teaser): ?>
Got a visible result with that (around line 30 in my file)
But it puts the post author and time at the end of the text instead of up under the title. Know how to change that?
Comment #6
aharown07 CreditAttribution: aharown07 commentedGot it! I don't know why this works, because I don't know PHP, but here's what I did...
Changed the
<?php if (!$teaser): ?>
at line 12 to<?php if ($teaser): ?>
(removed the "!")Added a "!" to the
<?php if ($teaser): ?>
around line 30... so it's now<?php if (!$teaser): ?>
Then I put Lioz's code above right after line 12.
The result was that the submission author/date/time info then appeared twice below the title.
Well, I'd noticed the same (or very similar) code already in the file after
<?php if ($submitted): ?>
at line 14.So I added a "!" to that, changing it to
<?php if (!$submitted): ?>
So far, that works.
What I surmised was that "!" is some kind of off switch. Am I close? Please tell me if I've broken anything important!
Comment #7
aharown07 CreditAttribution: aharown07 commentedCorrection. What I did above broke the comments etc. line that is supposed to appear below the content.
After a good bit of trial and error, arrived at this... this is the code of the entire node.tpl.php file... can't remember now what exactly I did to it. But this displays both the submission info below the title and the comments info after the content.
Comment #8
aharown07 CreditAttribution: aharown07 commentedComment #9
spangaroo CreditAttribution: spangaroo commentedThe solution in #7 works, but only brings the "metanode" info to the teaser. When viewing the full node, the author, date, and time aren't shown.
I'm on D6 and here's the code in my node.tpl.php file
Does anyone know how to configure node.tpl.php so the node, author, and date appear on both the teaser and the full node?
Any help would be greatly appreciated. Cheers :)
Comment #10
ae860300 CreditAttribution: ae860300 commentedhelp ~
If you want the page to add last update time of the page how to implement?
print t('By ') .'<span class="author">'. theme('username', $node).'</span>' . t(' - Posted on ') . '<span class="date">'.format_date($node->created, 'custom', "d F Y").'</span>';
Just created-> changed Well?
drupal6.16
Comment #11
drasgroup CreditAttribution: drasgroup commentedremove the conditional logic
like so
becomes
afaict