November Happy Hour will be moved to Thursday December 5th.
AI OnAI Off
November Happy Hour will be moved to Thursday December 5th.
Hi,
To work with versions you could use IContentVersionRepository:
var repository = ServiceLocator.Current.GetInstance<IContentVersionRepository>(); var id = 123; var versions = repository.List(new ContentReference(id));
i dont have id of the version. i only have page reference in backend now i want to get current version of the page that is being displayed to editor or publisher when they click on the page in site pages tree list
So you could use Id from your PageReference:
var pageReference = .... var repository = ServiceLocator.Current.GetInstance<IContentVersionRepository>(); var versions = repository.List(pageReference);
it will return all versions of that page. i want to select current version of the page(it can be or cannot be the latest version) among these versions
The answer is
var commonDraft = versionRepository.LoadCommonDraft(page.ContentLink, "en");
Hi
In my site multiple editors can edit page . so a page can have multiple unpublished versions. i want to know in the backend which is the current version of page. it can not be last version all the times.