lastBuildDate field ?

Created on 26 August 2023, 10 months ago
Updated 15 April 2024, 2 months ago

Hi

Just a question : what field are you using/matching in the view for the "lastBuildDate field" ?

D

πŸ’¬ Support request
Status

Fixed

Version

1.4

Component

Miscellaneous

Created by

πŸ‡«πŸ‡·France dbourrion

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @dbourrion
  • πŸ‡ΊπŸ‡ΈUnited States SocialNicheGuru

    published on date

  • Status changed to Fixed 3 months ago
  • πŸ‡ͺπŸ‡ΈSpain pcambra Spain, πŸ‡ͺπŸ‡Ί

    One way to do this without too much coding (but probably template altering) is to add a view or display using https://www.drupal.org/project/views_field_view β†’ , then use the same criteria for filtering that you have on your current view, sort by published or changed, limit the view to show just 1 element and then show the published/changed date with "D, d M Y H:i:s T" format. I think you will need to change the view template so it only shows the content without HTML wrapping.

    Alternatively, I've created https://www.drupal.org/project/views_state β†’ to support this with a little bit of glue code, you can add a presave every time the target content for the podcast is updated (normally a content type, in my case named "podcast")

    function my_module_node_presave(NodeInterface $node) {
      if ($node->bundle() == 'podcast' && $node->isPublished()) {
        \Drupal::state()->set('podcast_last_build_date', date('D, d M Y H:i:s T'));
      }
    }
    

    And then use Views State to show that as a field of the view and display it in the Style settings.

  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.69.0 2024