Unpublish a Sitecore item

Any regular Sitecore users knows there are many ways to publish an item. However it’s not always obvious how to “unpublish” an item. Its actually quite straight forward.

1. Navigate to the item you want to unpublish using the Content Editor. From the Publish ribbon select the Change button:

In change dialog, make the item unpublishable by deselecting the Publishable checkbox:

The content editor will display are warning informing you what’s about to happen.

The final step to actually publish the item and it will disappear from the front-end but remain in the master database. This may sound strange, but as the item is already published we need to publish again to remove it from the web database.

Sitecore Habitat Installation Issues

I’ve recently attempted to setup a Sitecore Habitat solution by following instructions from the GitHub site.

This was not as straight forward as I’d hoped. The following are some issues I had to resolve along the way.

Web Forms For Marketers

Ensure this is installed correctly and working. Although I had installed the module and it appear to be successful, when I checked System/Modules/Web Forms for Marketers items were missing. The problem didn’t become apparent until Unicorn tried to sync items relating to WFFM.

I also discovered although it’s not mentioned in the Habitat documentation MongoDB is required for WFFM to work correctly with Habitat.

NodeJS

After installing NodeJS I ran npm install from the root of the Habitat repository as instructed. However this kept failing while trying to install node-sass with a 404 error. Running npm install node-sass to manually install the package before running npm install resolved the issue for me.

Editing repository files

Make sure any files you’ve been editing are not open by another application

Unicorn Sync

Although the sync process should work fine through Visual Studio Task Runner. I found it more successful to run it through a command prompt using gulp.\

Gulp

Even after a success npm install I received a gulp command not found error when running gulp from a command prompt. Running npm install –global gulp-cli in the repository root resolved the problem.

 

Sitecore items not visible on website

Sometimes you may find an item appears in both the master and web database’s. But when you navigate to that item on the live website site either a 404 returned, or in the case of a component it’s not visible.

This could be because the item has publishing restrictions in place. There’s a few places to check:

  1. Log into Sitecore.
  2. Open the Content Editor.
  3. Select the View tab and ensure Standard Values is checked.
  4. Navigate to the offending item using the content tree and select it.
  5. Using the right panel scroll down to the Publishing section.
  6. Check the dates are either empty or valid for displaying the item as of today.
  7. At the bottom of the Publishing section there is a Never Publish checkbox, make sure this is unchecked.

If workflow is in place it might be worth checking the Workflow selection for this item. The state field will highlight where in the workflow this item is. However if the item is’t approved it shouldn’t show in the web database.

If the above doesn’t help its worth republishing the item or its parent..

How to reset NVRAM on your Mac

Shut down your Mac, then turn it on and immediately hold down these four keys together:

Option, Command, P, and R.

Keep holding the keys for about 20 seconds, during which your Mac might appear to restart. (If you have a Mac that plays a startup sound when you turn it on, you can release the keys after the second startup sound.)

CSS and JS files not being served correctly by IIS

If you receive a warning that that CSS and/or JS files are being ignored due to incorrect mime type. It could be IIS is not serving static content. Another indication is a blank content type field for static content in the IE developer tools network tab.

To resolve the issue:

  1. Go to Control Panel > Programs and Features
  2. Click Turn Windows features on or off
  3. Expand World Wide Web Services > Common HTTP Features
  4. Tick Static Content
  5. Click OK

Another cause is CSS and JS mime types being incorrect registered on the IIS server.  To check open regedit, expand HKEY_CLASSES_ROOT, find .css and check/change the Content Type value to text/css. Repeat for .js where the Content Type value should be text/plain.

Setting permissions for Application Pool Identity

IIS 7.5+ runs application pools using an Application Pool Identity rather than NETWORK SERVICE. To allow files to be created/modified you may need to change file permissions.

1. Open Windows Explorer
2. Select a file or directory.
3. Right click the file and select “Properties”
4. Select the “Security” tab
5. Click the “Edit” and then “Add” button
6. Click the “Locations” button and make sure you select the local machine. (Not the Windows domain if the server belongs to one.)
7. Enter “IIS AppPool\DefaultAppPool” in the “Enter the object names to select:” text box. (Don’t forget to change “DefaultAppPool” here to whatever you named your application pool.)
8. Click the “Check Names” button and click “OK”.

Note: Depending on IIS configuration you may need to add permissions for the application pool itself. Repeat the above steps but change AppPool\DefaultAppPool to AppPool\MyApplicationPool where the application pool is called MyApplicationPool

Sitecore generating Overlapping onDeckSearchers=x warnings in Solr logs

I’ve recently had an issue where every 10 minuets or so a entry would appear in the Solr logs. This was only an issue for the analytics core. After reading various articles and try different Solr configurations I failed to resolve the problem.

However after a chat with Sitecore Support the issue was resolved by a quick change to our Sitecore environment. Our production environment consists of four separate Sitecore instances, two delivery, one authoring and one processing server. By default Sitecore uses a Timed Index Refresh Strategy to update Solr’s analytics core. By having four environments pointing to the same Solr instance, the analytics core was being updated four times simultaneously.

When a processing server is being used only that should update the analytics core. In an environment without a processing server it would the possibility of authoring server.

To resolve the issue the processing server was left with the default Timed Index Refresh Strategy. Automatic updating of the analytics was disabled on the remaining three environments by changing the strategy to manual.

The strategies are set in the Sitecore.ContentSearch.Solr.Index.Analytics.config file. The default is:


<strategies hint="list:AddStrategy">
   <timed type="Sitecore.ContentSearch.Maintenance.Strategies.TimedIndexRefreshStrategy, Sitecore.ContentSearch">
      <param desc="interval">00:01:00</param>
   </timed>
</strategies>

To use a manual strategy remove the above from the config file and add:


<strategies hint="list:AddStrategy">
   <strategy ref="contentSearch/indexConfigurations/indexUpdateStrategies/manual" />
</strategies>

Rather than updating the config file a better solution would be creating a patch file. This way if the config file is replaced during an upgrade the config change will still be applied.

Remove cached credentials from Windows

The utility to delete cached credentials is hard to find. It stores both certificate data and also user passwords.

Open a command prompt, or enter the following in the run command:

rundll32.exe keymgr.dll,KRShowKeyMgr

Windows 7 makes this easier by creating an icon in the control panel called “Credential manager”