Whenever we work with a client on a Sitecore implementation, it is inevitable that at some point in the process, the question of scheduling future publishes will come up. The question is usually phrased something like “Does Sitecore allow me to schedule an item to be published in the future?” Every time it comes up, I have to chuckle a little to myself, because of the answer that immediately pops into my head. That answer is “Well, out of the box, sort of, kind of, but not really, no, at least not in an effective real-world manner. But yes, that can be done.” And I legitimately think that’s the “right” answer.
I know, you’re now saying to yourself, “How can that be the right answer? You said yes and no and yes again all at the same time, and still managed to not really say much of anything.” Well, let me explain. Out of the box, Sitecore gives the content editors the ability to restrict the publication of any given item (or even specific versions of an item) right in the desktop. To see this in action, navigate to the “Publish” menu of the Sitecore Desktop Ribbon, and click the Change button in the Restrictions section. You will get a pop-up that now lets you put in dates for both when an item should go live, and if necessary, when it should be removed from being live. The following screenshot shows a portion of this popup:
So, now you’ve got to be thinking “That’s awesome, but doesn’t that answer the original question with a resounding ‘Yes’?” It sure seems to, except for one little caveat – there’s nothing out of the box with Sitecore that does automatic publishing. So, given the example in our image above, the current item is only to be published between 3/12/12 at 1:30PM and 3/30/12 at 12:30AM, and that’s what will happen when a content manager explicitly publishes the site. The first time the site is published after 3/12/12 1:30PM, the item I’ve modified above will be published – so if that first time is 3/15 at 8:30PM, then we had 3+ days where our item wasn’t published, but should’ve been. Likewise, the first publish explicitly performed after 3/30/12 12:30AM will automatically remove our item from being published, but our item won’t disappear a second before that first publish. This can be a little misleading to content managers who stumble upon the first screen on their own, as it seems to indicate a positive answer to the question “Does Sitecore allow me to schedule an item to be published in the future?” It’s important that we, as developers make sure they’re aware of exactly what that publish restriction date does and does not do.
So, I think that details the “sort of, kind of, but not really, no” portion of my answer – now let’s get to the “But yes, that can be done” portion, which is obviously the part clients care most about – the “Yes, I can help you make that happen” part. A coworker of mine has written some code that when called by a scheduled task, will perform a smart publish on a given site. The code is thus:
Once you’ve got that code, you simply need to put it in a place that allows you to call it in a schedulable way. There are lots of options to do this. One way is to call the above code from a particular webpage that, while publically accessible, is not publicized as a part of your Sitecore site (IE: a page that no one knows exists). Once you have that page, you can schedule a windows task to call your page at a regular interval, and it will automatically perform a smart publish on your site.
Now you have the means to allow Content Managers to administer date restrictions on when items should be published through the Sitecore desktop, and a means to do automatic publishing through a small bit of custom code. It’s important to note the ramifications of a scheduled publish though. If your site requires that content goes live at the same time on any given day, you can get away with having your scheduler only call the above code once a day at the proper time. This should be completely acceptable, and really happen without a hitch. However, what if your site might need content that goes live at 8:30AM, or 8:45AM, or 12:17PM, or any other arbitrary time of any given day? Well, then you need your scheduled task to run much more frequently – possibly once every minute. It’s certainly possible to set your task up to do this, but there will absolutely be an increased amount of processing strain placed on your server to run this code continuously. Having the ability to publish automatically whenever we want to does not make doing so a best practice. Another consideration that needs to be clearly communicated to all of your Content Editors when implementing an automatic publish feature is how it affects their items. Any item that is not in a non-final workflow state, and doesn’t have publishing restrictions upon it will be published by the above code. That means, if you have your auto-publish scheduled to run at 8:00AM every day, and a content editor saves a change to an item (without any workflow attached to it) at 7:59AM, but does not intend for that item to be published right away, they will be out of luck, because it will be published automatically.
We should be prudent here and say that implementing the above code alone does not preclude a content manager from explicitly performing their own Sitecore publish at anytime they wish. Our code could be used as the sole means of publishing by removing publish rights from all content editor permissions within Sitecore, thus ensuring that the site is only published when it is scheduled to be. Our code can just as easily be used in addition to “on-demand” publishes performed by content managers to help prevent items that should be published / unpublished on a schedule missing their target dates. If you have content managers who are really on the ball, it’s also conceivable they will do regular publishes when they need to be done and you don’t have to implement an auto-publish at all. Each Sitecore implementation should have its own business rules relating to the publishing of content, and those rules should dictate the methodology that is used.
So, the next time you hear someone ask (or have the question yourself) “Does Sitecore allow me to schedule an item to be published in the future?”, you can feel free to quote me by saying “Well, out of the box, sort of, kind of, but not really, no, at least not in an effective real-world manner. But yes, that can be done.”, and have confidence that yes, this can be done without a lot of effort!
My 4 days in the Desert with Adobe — Part 2
Fri, Mar 7th 2014 7:12a Eric Herman As I mentioned in my last blog post, the time I spent in the desert with Adobe at the sales conference was incredibly valuable. As the best of breed digital platform, three key themes resonated with me and want to take the opportunity to delve a little deeper into the benefits of the adobe partnership and how it impacts the work we do for clients.
One of the first things I learned is that Adobe has grown tremendously over the past few years and has really cemented its place as the leader in digi [read] Keywords: development
Facebook Introduces New Campaign Structure
Thu, Mar 6th 2014 1:12p Mark Polly Facebook has been hailed and maligned at the same time for its advertisement features. On one hand, Facebook ads promise to reach large, targeted audiences with your message. On the other hand, Facebook ad reach is a black box that only Facebook controls. In a previous post, Why Facebook is Failing Marketers, my colleague Michael Porter wrote about Facebook ads reaching only 16% of a company’s fans.
I don’t know if the New Facebook Campaign Structure that Facebook is rolling [read] Keywords: facebook
My 4 Days in the Desert with Adobe – Part 1
Fri, Feb 28th 2014 12:12p Eric Herman In mid-December, I attended the Adobe Worldwide Sales Conference in Las Vegas. It’s a time when Adobe invites its entire sales organization – along with Adobe’s key partners – to discuss the past year’s performance, celebrate the major sales successes, and layout the company’s sales and product strategies for the next year.
As Forrester & Gartner’s leader in Web Content Management, Adobe certainly has much to discuss and no lack of thought leadership within the Digital Marketin [read] Keywords:
A Primer on CMO, CIO Collaboration
Thu, Feb 27th 2014 8:11a Michael Porter Tom Wentworth at CMSWiRE has a short but very interesting article on collaboration between the Chief Marketing Office and the Chief Information Officer. He engages you at the beginning with the reasons why the two roles are blurring. I personally of one CIO who also wears the CMO hat.
…today’s marketers have a required skillset that often overlaps with that of the CIO, who has traditionally managed and maintained a company’s IT infrastructure. For that reason, CMOs are becoming int [read] Keywords: collaboration
Cool Mobile Infographic
Wed, Feb 26th 2014 5:12a Michael Porter Thanks to the Marketing Tech Blog for a reference to a cool “Future of Mobile” info graphic by Three. It’s UK focused but still a nice summary of mobile. I especially like the internet use via mobile devices now and in 2025. Click to get to the entire info graphic. [read] Keywords: mobile
What’s The Difference Between Beacons and Geofencing
Tue, Feb 25th 2014 5:12a Michael Porter Thanks for John Spyers for pointing this out to me. I’ve heard a lot lately about the “contextual” experience. By that I mean, an up to the minute completely personalized experience based on more than just what a company knows about you. Now you can take into account all of the usual items like how good a customer they are, do they have a shipment on the way, and did they just call customer service. You can add to that things like, where are they and do they have a rese [read] Keywords: mobile
What Does SoftLayer Mean for IBM?
Tue, Feb 25th 2014 5:12a Michael Porter So I’m not the cloud guy within Perficient but let’s face it, everything I see within my portal, web content, social, and marketing automation world has some cloud component. Let me give you some examples:
We see more and more requests to host IBM Portal and IBM WCM on an easy to manage external entity. Perficient uses a partner, Blue Iron because they stand up actual working instances of software and support more than just the base OS.
Sitecore has a Sitecore Azure option which [read] Keywords: ibm
5 Signs of A PC Exodus
Mon, Feb 24th 2014 6:12a Michael Porter CRN has an article on five signs of a PC exodus. Given all the stats we’ve seen on the dominance of mobile, I’m not surprised. Here are a couple mobile stats to consider before I list the five signs.
And now the list: (Go to the CRN article to get more in depth information)
Is LG leaving?
Asus’ smartphone shift
Acer’s executive shakeup
Samsung dumping desktops? [read] Keywords: mobile