- Issue created by @alex.skrypnyk
- Assigned to fionamorrison23
- Status changed to Postponed: needs info
9 months ago 7:27pm 12 March 2024 - 🇦🇺Australia alex.skrypnyk Melbourne
@fionamorrison23
Promo card is one of the teaser display modes for a content type. So the logic could potentially apply to other content types shown as different cards etc.I suggest introducing a per-content type setting in the theme settings (similar to what we have for components) to let the site owner to choose what date is shown in teasers for what content type. These settings will also per-content type settings for other properties specified in other tickets (for example - per-content type node Light or Dark theme).
Once introduced, it will be up to the site owner to choose how this is displayed.
- Status changed to Active
6 months ago 8:04am 9 July 2024 - 🇦🇺Australia sime Melbourne
I'm not sure if the date should be selectable but it definitely shouldn't use the "changed date" for promo cards, it should use the date created.
- 🇦🇺Australia sime Melbourne
This is all really the job of entity bundle classes, but fwiw i've changed the theme to do this to get the created time.
I needed to add (int) because getCreatedTime() returns timestamp as a string.
* Pre-process for Date node field. */ function _civictheme_preprocess_paragraph__node_field__date(array &$variables): void { if ($node) { - $variables['date'] = civictheme_format_datetime($node->getChangedTime(), 'civictheme_short_date'); - $variables['date_iso'] = civictheme_format_datetime_iso($node->getChangedTime()); + $variables['date'] = civictheme_format_datetime((int) $node->getCreatedTime(), 'civictheme_short_date'); + $variables['date_iso'] = civictheme_format_datetime_iso((int) $node->getCreatedTime()); } }
- 🇦🇺Australia alex.skrypnyk Melbourne
@sime
Every site owner have their own opinion about what timestamp should be used in what type of a card.
Currently, there are 3 for `Page`:
- Created date
- Updated date
- Manually set Last Updated dateThis issue is about implementing such flexible configuration.
- 🇦🇺Australia sime Melbourne
I can't speak for the extra data fields, I would love to hear an example of using the updated date on a card (which is the default being used here) - it's always interesting to learn about different requirements.
I've just come across this issue again. I made an update to a node where I have set a custom last updated date. I want that date to remain custom as the page has content that is important to know when the content was published. This page is referenced in an Automated list on a promo card. It now shows today's date in the promo card, but I want it to reference the custom last updated date from the referenced node.
Would there ever be a case where a promo card and the node it references needs to have a different date? Unlikely.
To me, it makes sense for the promo card (and any other cards that show a referenced date) to reference the Custom last updated date. That way the user has total control over the date on the node and the cards.Thoughts @sime @alex.skrypnyk @richardgaunt?
- 🇦🇺Australia alex.skrypnyk Melbourne
The Custom date is an override. If it is not selected by the user, a published or updated date should be used instead.
Promo or any other cards/snippets/etc are just the ways to display the referenced content. IMO, the logic should be consistent across all components, but configurable per content type.
So, for "News", for example, a site owner may chose "Updated date" (and Custom date would override it if set by the user)
But, for "Events", for example, a site owner may chose "Created date" (and Custom date would override it if set by the user)