0

When I create an article and I don't publish it, so I could edit the article later and publish it when it's finished, I notice Drupal shows the creation date, not the publishing date.

Is there a way to change it so the items on the front page show their publishing date and not the creation date? Is there a different field in the database for that functionality?

I am using the Workbench module, which gives draft nodes. If nodes are not published, it will display them in a draft list.

6
  • may be if you create a revision in contentype settings, this way you have a record on every change.
    – pinueve
    Sep 26, 2017 at 5:27
  • How to get published date?
    – steniya
    Sep 26, 2017 at 5:33
  • @steniya from the node_revision table I suppose. Sep 26, 2017 at 6:20
  • I checked with node, am getting only published date and changed date. If I take changed date, there is a issue. Suppose record "A" is created on Sept 10 and it is published on Sept 15, then I updated the record on Sept 25. It will display the date as Sept 25 but the record got published on Sept 15. How I can display Sept 15?
    – steniya
    Sep 26, 2017 at 6:30
  • would it be acceptable to you to UPDATE the creation date at the time the node becomes published (with the publish-moment being used as creation date)? Sep 26, 2017 at 8:50

1 Answer 1

0

The Publication Date module adds a field on every node that shows when a node was published.

The Publication Date module adds a "Published on" date for each node, containing the date when it was first published.

Without this, the only dates available for nodes are their created date and changed date, but these are often insufficient to meet the needs of publishing workflows. Sorting nodes by their created date doesn't account for content which is held in draft form for a time while being readied for publication. Sorting nodes by their changed date fails to account for content needing minor corrections after being published.

screenshot

For nodes published before the module was installed, the module will use the node creation date, as the project page itself says.

For nodes that were published before the installation of this module, we can not know the exact date of publication, so $node->published_at will initially contain the creation date.

2
  • I have 5000 records which are already created. This module is not applicable to those records. It can use in future. Am right?
    – steniya
    Sep 26, 2017 at 7:30
  • 1
    You can use this module for existing nodes. It will look for the right date.
    – shelane
    Aug 27, 2021 at 11:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.