How to publish multiple versions of content item to delivery (web database) in Sitecore? - sitecore

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.

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").

Related

How to publish all versions of an item to Web DB (Sitecore 8.0+)

The end result:
After publishing an item, all versions will be visible in the WEB DB, instead of the default behaviour of only having the latest item version.
I'm using Sitecore 8.2.170407
After reading this article, I tried to do several things:
Remove both RemoveOtherVersions and PublishTestingVersions processors by doing a <patch:delete />. That did not work
Add my own patch file, which inherits Sitecore.Publishing.Pipelines.PublishVersion.Processors.RemoveOtherVersions and hides/overrides the base Process method. The new method will do nothing.
Image of patch class and Image of patch config
That didn't work either.
Tried removing the whole <publishVersion> pipeline, but that gave an exception when trying to publish an item.
I've not been able to find a solutions anywhere else. I know a similar question has been asked here, but that was in Sitecore 6
Have any of you been in the same situation before? How did you solve the issue?
If you need more information, please let me know.
Thanks in advance
You can't.
The linked answer you provide is still valid. Sitecore "web" database (any database which is a publishing target) stores one and only one version. To modify this, you're going to need to reinvent your own publishing process.
Based on your clarification, it seems what you want to use is standard Sitecore versioning with specified publish start dates to put up a particular version.
All of the versions would live in your master database, and you would regularly run publishes through the publishing agent or some other means in order to send the appropriate version to the web database on the correct date.
Your authors can preview what the page would look like on a particular date using the date picker in the preview mode.

Sitecore 8: how to track Content Editors activity?

We have a website featuring Sitecore 8.1 with multiple content editors. Is there any way to log their activity, as in listing the actions they have performed in terms of editing/publishing/unpublishing?
We had a problem last week which I suspect being caused by someone unpublishing the wrong item, but I need to make sure this is the case, or at least I would like this ability in the future.
Do I need to create my own event-triggered logging?
There's nothing fully out of the box to provide those reports in Sitecore. You can take a look at the Sitecore Audit Trail module which will log all the "editor action" audit information into a separate log4net appender. You can find more information on the module in this blog post, but note that the module is only mark as compatible to Sitecore 7.5, it should not be hard to make this work with Sitecore 8.1, namely updating the appender config since the log4net config is now within the <sitecore> node in config.
Sitecore does log content editor actions out of the box in the normal log files (in Data\logs), they start with "AUDIT" so you can find them. It logs things such as items being saved, publishes starting, etc. Do a search in the log files to find them.
You can get these saved to a separate log file for easier review: https://sdn.sitecore.net/scrapbook/how%20to%20make%20sitecore%206%20write%20audit%20log%20to%20its%20own%20file.aspx
This still works in Sitecore 8 except the setting is in App_Config/Sitecore.config now.
You can use Sitecore Advanced System Reporter
Sitecore 6 ships with a very useful function called My Locked Items. At times, though, admin users may want to see all locked items, not just those locked by them. I wrote a little application to do just that. Then I thought of making it more generic, so that one could create other type of reports easily. The result is a little framework which allows to create many types of reports in very short time. In this module I provide this framework together with many useful example reports like:
items modified updated in the last X days
items that have more than X children
items that are publishable but either do not exist or have a different version in the web
database.
items that are based on a particular template
items with validation errors
which templates have been linked to a workflow
locked items
publishable items with broken links
audit information
errors in the log files
items that have stayed in the same workflow state for more than X days
and more.
You can now also parametrise those reports, save them as links in the desktop, export them, or even create a scheduled task that emails some of them automatically. In addition, you can also apply commands to the items reported.
You can download the module from : https://marketplace.sitecore.net/en/Modules/A/Advanced_System_Reporter.aspx
Module is available for Sitecore 6.4 to 8. I don't know if has the functionality you look but you can customize it.
You can check this blogpost how to extend it: http://www.seanholmesby.com/sitecore-auditing-with-the-advanced-system-reporter/
Update
Install the module
Run the module and choose reports like in picture.
Run the report
View the report or export it like csv, excel or xml .

sitecore is failing to publish language versions to web database

We have upgraded Sitecore to 7.1, but we are experiencing a problem with publishing.
We create a new item in the master database in English, then we publish this item, switch to the web database to check if it's there, which it is, however... The item does not have a version! Therefore the item is not displaying on the website.
Any ideas as to what could be causing this?
Thanks.
I was having the same issue with Sitecore 8+ where i was able to add language specific content but couldn't publish it. Figured out how to resolve it
1) First Language needs to be registered in \sitecore\system\languages by defining the language to be use.
2) Publish these language items first before publishing content else the behavior will be the same.
3) After publishing languages, then publish the content. In the publish window you will see the language under "Publishing language" section and select the language to publish the content.
Make sure that parent items have a version as well and are also in final state if they are part of a workflow.
I had problems with publishing because I didn't have a language version in one of my parents. In my case it was a parent folder under the content node.
Hope it helps.
Al
Please try republishing your entire site. In some cases, a part of the tree hierarchy might be missing in the Web DB, due to which, publishing the child nodes wouldnt work. Republishing the site can eliminate this chance.
This has been resolved.
It turns out that the SQL server did not have enough space for a full publish. A full publish had been attempted and failed due to the lack of space on the SQL server. subsequently this had corrupted the database.
We had to restore an earlier version of the database and ensure the SQL server had plenty of space for the full publish to finish.
I ran into this issue earlier with my Sitecore 7.2 upgrade. The key here is to ensure the items, templates and layouts (associated with the item) all has appropriate language+versions in master db. In my case, we were also using Partial Language fallback and needed to make that was working proper as well.
Once you identify the item (with missing versions), add them and republish the whole item. For few template types I noticed Sitecore was still not publishing properly. Ex: Items based off Sublayout Folder template. The fix was easy in this case as I changed the template type to Folder and republished.
Also switch to web database in sitecore client and ensure you are able to preview the item (from web db)
Hope this helps.

How to efficiently publish in Sitecore 6.4 items in non-final workflow states?

While items that have reached a final workflow state can be easily published to the WEB database using, for example, a scheduled task that calls PublishManager.PublishSmart, I would like to be able to publish the latest version of all items that are in any workflow state to a different publishing target (for internal preview), essentially bypassing workflow.
What would you recommend to be the most efficient way to perform this, keeping in mind that this needs to happen a few times a day on a schedule and not every time an item is modified and/or changes workflow state?
How would that recommendation change if I changed the requirement by saying that only items that are in some (final and/or not final) specific workflow state (e.g. pending approval and approved) need to be published to the preview publishing target on a schedule?
See this blog post by Alex Shyba: http://sitecoreblog.alexshyba.com/2010/09/publish-to-pre-production-web-database.html. That workflow provider plus a standard publish agent should get you what you are looking for.
You may just want to configure a site that points at the Master database. See this stackoverflow answer on setting up a preview site: Preview site for Sitecore editors
Publish in the context of a site (as defined in web.config under <sites>) that has enableworkflows=false.
Untested, but something like:
using (new SiteContextSwitcher(SiteContextFactory.GetSiteContext("system"))) // workflows not enabled
{
var options = new PublishOptions(Context.ContentDatabase, Factory.GetDatabase("web"), PublishMode.Smart, null, DateTime.Now);
options.PublishingTargets.Clear();
options.PublishingTargets.Add("internal preview");
new Sitecore.Publishing.Publisher(options).Publish();
}
See this answer to the opposite problem!

Sitecore development and demo servers

I'm attempting to get an understanding of what is a best practice / recommended setup for moving information between multiple Sitecore installations. I have a copy of Sitecore setup on my machine for development. We need a copy of the system setup for demonstration to the client and for people to enter in content prelaunch. How should I set things up so I people can enter content / modify the demonstration version of the site and still allow me to continue development on my local machine and publish my updates without overwriting changes between the systems? Or is this not the correct approach for me to be taking?
I believe that the 'publishing target' feature is what I need to use, but as this is my first project working with Sitecore and so I am looking for practical experience on how to manage this workflow.
Nathan,
You didn't specify what version of Sitecore, but I will assume 6.01+
Leveraging publishing targets will allow you to 'publish' your development Sitecore tree (or sub-trees) from your development environment to the destination, such as your QA server. However, there is potential that you publish /sitecore/content/home/* and then you wipe out your production content!
Mark mentioned using "Sitecore Packages" to move your content (as well as templates, layout items, etc...) over, which is the traditional way of moving items between environments. Also, you didn't specify what version of Sitecore you are using, but the Staging Module is not needed for Sitecore 6.3+. The Staging Module was generally used to keep file systems in sync and to clear the cache of Content Delivery servers.
However, the one piece of the puzzle that is missing here is that, you will still need to update your code (.jpg, .css, .js, .dll, .etc) on the QA box.
The optimal solution would be to have your Sitecore items (templates, layout item, rendering items, and developer owned content items) in Source control right alongside your ASP.NET Web Application and any class library projects you may have. At a basic level, you can do this using built in "Serialization" features of Sitecore. Lars Nielsen wrote an article touching on this.
To take this to the next level, you would use a tool such as Team Development for Sitecore. This tool will allow you to easily bring your Sitecore items into Visual Studio and treat them as code. At this point you could setup automated builds, or continuous integration, so that your code and Sitecore items, are automatically pushed to your QA environment. There are also configuration options to handle the scenario of keeping production content in place while still deploying developer owned items.
I recommend you looks at the staging module if you need to publish to multiple targets from the same instance, i.e. publish content from one tree over a firewall to a development site, to a QA site, etc.
If you're just migrating content from one instance to another piecemeal, you can use Sitecore packages which are standard tools to move content. The packages serialize the content to XML and zip it up and allow you to install them in other instances.