Closed (duplicate)
Project:
Drupal core
Version:
8.0.x-dev
Component:
node system
Priority:
Normal
Category:
Feature request
Assigned:
Issue tags:
Reporter:
Created:
20 Jun 2011 at 19:39 UTC
Updated:
20 Apr 2020 at 17:03 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
jnz31 commentedi was actually looking for the same and found the place to look at:
best practice is (i guess!! me = complete noob) to copy the module node into your sites/all/modules/ and change the file node.module
around line #1469 (drupal 7.4) you'll find the row
$variables['submitted'] = t('Submitted by !username on !datetime', array('!username' => $variables['name'], '!datetime' => $variables['date']));Comment #2
nevets commentedModify any core file is anything but a best practice. One can implement hook_preprocess_node() and change what is shown that way.
Comment #3
karschsp commentedI ran across this tonight, I needed to display just the date information, not the author information. I know this can be done in the theme layer, but it might be nice to offer two checkboxes on this screen.
I'm working on a patch, but may need some help. I'll post what I have shortly.
Comment #4
karschsp commentedHere's the patch I mentioned above.
Comment #6
karschsp commentedNot sure why this failed. Passed locally. Also, marking as 8.x-dev.
Comment #7
bfroehle commentedChange Display to display.
Ditto.
Extra whitespace.
Perhaps this should turn into one of 4 possibilities:
Submitted by !username on !datetime.
Submitted by !username.
Submitted on !datetime.
(noting)
Having two Submitted by phrases is clumsy.
Whitespace. There are lots more whitespace bugs, but I'll skip the remainder.
The testbot errors all come because you'll also need to change garland/node.tpl.php.
Is there an upgrade routine?
Obviously this isn't a candidate for inclusion in D7.
Comment #8
karschsp commentedHere's an updated patch with a bit of a difference approach.
Instead of creating new variables, I just put the info in the existing $variables['submitted'] in template_preprocess_node() depending on which boxes they have checked. Still needs tests which I hope to get to those tonight.
I also took a stab at an upgrade path...
Comment #10
karschsp commentedCan anyone help on tests on this? I'm not quite sure how to test the various combinations...since everything's essentially wrapped in
$submitted
Comment #11
naught101 commentedIt might be a good idea to just try to fix all the current tests that this braeks first. Doing that would give a good idea of how to go about setting up a couple of conditional tests.
Couple of comments:
http://api.drupal.org/api/drupal/core--modules--node--node.module/functi...
Would probably be easier to read, and perhaps slightly more efficient to get each variable once before the if section.
else and ifelse go on a new line, according to coding standards.
Nice work so far, keen to see this in action!
Comment #12
naught101 commentedAlso, this might be a better solution in the long run: #1399990: Remove "Display author and date information" in Display Settings in favor of listing Author and Date in Manage Displays
Comment #13
cesar.brod@gmail.com commentedSubscribing!
Comment #14
naught101 commentedYou don't need to comment to subscribe. Please use the big green "follow" button at the top of the page.
Comment #15
jenlampton+1 for separating these options, but I'd also love to see them on the manage display tab, as per
#1399990: Remove "Display author and date information" in Display Settings in favor of listing Author and Date in Manage Displays
Comment #16
yoroy commentedWould be a nice little UX tweak that gives people more flexibility where they are likely to want it. Do it! :)
Comment #17
colanThe revisions tab should honour this as well. So, for example, if displaying author information is disabled, the author shouldn't show up in the revisions table (on the Revisions tab) either. See #1566082: Author is shown in Revisions table when "Display author and date information" is off.
Comment #18
colanThis is a new feature, not a support request.
Comment #19
rajat42059 commentedYou can download the module called submit by and then through this you can easily edit and format the information you want.
Comment #20
markhalliwellDup of #2047095: Remove $submitted from node templates
Comment #21
surendra77c commentedIn node.tpl.php write the below code to get the author name .
C:\xampp\htdocs\drupal7\themes\bartik\templates\node.tpl.php
print_r($node); // get list of all the variable like date , submitted date , author name , content type name etc .
Comment #22
numerabilis commentedEu estava procurando colocar a data da última atualização também.
Estou usando Drupal 7 e o tema Pixture Reloaded.
Em algum lugar eu ví que tinha que alterar no tal de preprocess do node.
No meu caso estava em:
/sites/all/themes/adaptivetheme/at_core/inc/preprocess.inc, line 732: