I need to retrieve the published versions of a content, to sent it to some API. I'm using that piece of code below to retrieve my versions, but I don't find any flag that states if this version has ever been published.
I need to track the previous published content name of a published item, as well I should be able to get an url of that version.
The url is lost when a new version of the document is published.
I am pretty sure that you'll need to subscribe to the ContentService.Published event. After a publish, just store the versionId, date, url along with other things you need in a new database table.
Yes,
I do that operation on the published event as we need to be sure that the content is visible as it will be crawled by some search engine.
Unfortunately we need also information on the previous state of the content, the umbracoRedirectUrl is not an option as we don't have the publish story either.
So for now indeed either a table with all that information, either some preprocessing on the Publishing event (which could be some double expense on this action, as renaming url cause all descendants to be renamed as well) seems the only way.
Versions and tracking of published versions
Hi,
I need to retrieve the published versions of a content, to sent it to some API. I'm using that piece of code below to retrieve my versions, but I don't find any flag that states if this version has ever been published.
I need to track the previous published content name of a published item, as well I should be able to get an url of that version.
Any idea on how to achieve ?
The url is lost when a new version of the document is published.
I am pretty sure that you'll need to subscribe to the ContentService.Published event. After a publish, just store the versionId, date, url along with other things you need in a new database table.
Make is much easier to retrieve afterwards.
Kind regards
Damiaan
Yes, I do that operation on the published event as we need to be sure that the content is visible as it will be crawled by some search engine.
Unfortunately we need also information on the previous state of the content, the umbracoRedirectUrl is not an option as we don't have the publish story either.
So for now indeed either a table with all that information, either some preprocessing on the Publishing event (which could be some double expense on this action, as renaming url cause all descendants to be renamed as well) seems the only way.
is working on a reply...