问题
I have a requirement to allow users of the web site to see the current publish version of the item (which has passed through workflow) + the previous versions + the version scheduled to publish in future. So when the use visit the content item on the web site they will be presented with tabs to: previous , current and future version of the item.
I have seen some articles how to intercept publishing pipeline but still cannot evaluate if this scenario is possible.
回答1:
There is no native way to allow multiple versions to be published live at a given time. This comes down to how the publishing process works for Sitecore. At a high-level, let me explain:
The authoring environment which uses the master database contains 0-n
versions of each item. When a user decides to publish a piece of content, only the latest version marked as "final" will be published to the publishing target database, e.g. usually the web database. The publishing target database (e.g. web) will always only have ONE VERSION of a given item, unlike the master database.
Let me say that again:
The front-end public-facing website's database only has ONE VERSION of a given content item at any time.
Since you indicated the front-end of the site needs to show three versions coming from:
- Previous
- Current
- Future
This means that the pure requirement of showing a "future" version to be published means your site would not use a typical master-to-web publishing model and would instead need to run in "live mode" which runs from the master database. As I said, you would not even publish at all and would render content as you edit/save it.
So, for this reason, you'd need to code your front-end presentation component(s) which generate the tabs to query the item and get the current version, the previous version (assuming it was "final"), and a previous version (assuming its "final").
来源:https://stackoverflow.com/questions/12887245/how-to-publish-multiple-versions-of-content-item-to-delivery-web-database-in-s