Replies: 2 comments 2 replies
-
|
You could create a custom map index to store the |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
Thanks @hishamco It is a good idea for keeping it searchable by index. I'm using liquid templating to create URLs and display the pubished date in the UI. So, once I get some content items back from a query I feel like I need a property actually on each content item so I can access the value with a liquid template. It seems maybe adding something like a new "DateFirstPublishedPart" migth be the only way? |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I'm trying to orgnaize my content by the date the content items were originally published e.g. with blog style URLs such as site.com/2025/03/05/the-post-slug. I have a system for building the URL structure based on the PublishedUtc property on content item. The problem is, if I update the content item, PublishedUtc is also updated and I want to continue to keep it organized (and searchable through a database index) based on the time it was first published. The "first published" date never changes but the PublishedUtc property does. The only other dates I see are CreatedUtc (which never changes but isn't the published date) and ModifeidUtc (which changes on every update, including after initial publication). I sort of would have thought ModifiedUtc would change every time I update it and PublishedUtc would stay fixed at the original date it was published but Orchard Core doesn't work that way (and of course that is also perfectly logical because if it was published again, the published date changes).
So, I'm thinking of adding a DateFirstPublishedPart with a field on it that gets populated the first time a content item is published and then never changes. Is there anything already built into Orchard that would give me this "first published" value and if not, is it something that might be worth adding to the ContentItem type or is that too "core" of a type to be adding to at this point? I know I could version the content type and probably look up the first published version but I want something simple that is just always on the latest published content item.
Beta Was this translation helpful? Give feedback.
All reactions