Handy tips

Event log error from Ektron aliasing module

Have you ever seen this error in your event viewer on an Ektron site?

Message:Resource not found Stack trace:  

   at Ektron.Cms.UrlAliasing.StaticFileHandler.
_GetFileInfo(String filename)
at Ektron.Cms.UrlAliasing.StaticFileHandler.System.Web.
IHttpHandler.ProcessRequest(HttpContext ctxt)
at System.Web.HttpApplication.CallHandlerExecutionStep.
System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep
step, Boolean& completedSynchronously)

It can be tricky to figure out what this is all about as the error message doesn’t say what the file is that is missing.  I had this recently on a site and figured out what it was by trawling through the IIS logs.  I found a number of 404 Page Not Found errors that corresponded to the messages in the event viewer.

Strangely enough, it turned out to be a missing fav.icon file!

For a while I was sure it meant there was a template missing.  I can’t guarantee that it will be fav.icon in every case, but its worth hitting the IIS logs to see if you can match 404 errors to the event viewer.

Resize images on the fly with Ektron

Did you know that from version 8.5 of Ektron CMS you can resize images dynamically with no extra coding required?  There are a few restrictions:

  1. File must be added as an asset to the DMS – it cannot be a Library file.
  2. It must be a JPEG or GIF file – PNG will not work.

So here is what you do :

  1. From the workarea, go to the Content view
  2. From the toolbar choose the Add Assets icon.
  3. Browse to your image and upload it.
  4. Go to the Properties tab on the image and make a note of the Content Id.
  5. Now browse to the image like so :

http://www.mysite.com/assets/123.jpg?ht=100

This will load the image and resize it so that the image is 100 pixels high- the width size will be constrained to the height, i.e. the proportions are kept the same.

The “123” specified here corresponds to the Content Id – this is important, you must use the Content Id and not the QuickLink.

You can also specify the image resize by width:

http://www.mysite.com/assets/123.jpg?wd=200

Or you can resize by both height and width (potentially throwing out the proportions):

http://www.mysite.com/assets/123.jpg?wd=200&ht=150

Or you can show the auto-generated image thumbnail:

http://www.mysite.com/assets/123.jpg?sz=thumb

This gives a very nice way of showing an image in a particular size without having to resize it through code.  Before version 8.5 it would have been necessary to write a plug-in or extension that resized images after publication.