Archive for November, 2010

Reasons why to upgrade EPiServer CMS

November 26th, 2010

Many have written articles about how you upgrade EPiServer 4.6 sites to CMS 5 but rarely why with reasons and benefits to do so. Even though EPiServer CMS 5 was released over three years ago, too many companies still use EPiServer 4.62 and some have even older versions. Why? Well, our customers need concrete arguments to motivate the cost, other than the usual “because it’s a new better version”. Worth noting is that it’s likely an increased risk the customer changes their publishing system entirely if they use an older version.

Therefore, I have put together a list of reasons (in no particular order) why companies should upgrade their EPiServer 4 websites to EPiServer CMS 5 (or preferably the newer version 6).

(more…)

Disable double click to prevent multiple execution

November 19th, 2010

There are still users who double clicks a link or button and web developers sometimes need to do a workaround to avoid the action being triggered twice in a row. (For instance adding an item to a database or downloading a generated file)

All the scripts and workarounds I found on the web for disabling doubleclick was unneccesary complex and disabled the link/button forever after being clicked once, without the possibility to click again unless reloading the page. So I had to dig out something I wrote a long time ago, which disabled double click but only for a short while.

This nasty little javascript disables any link with a single onclick statement, and works fine with ASP.NET controls also by writing OnClientClick=”return disableDoubleClick()” as an attribute. Click on the download link to open the demo.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
<script type="text/javascript">
disableDoubleClick = function() {
        if (typeof(_linkEnabled)=="undefined") _linkEnabled = true;
        setTimeout("blockClick()", 100);
        return _linkEnabled;
    }
    blockClick = function() {
        _linkEnabled = false;
        setTimeout("_linkEnabled=true", 1000);
    }
</script>
 
Test it here:<br />
<a href="http://shahinalborz.se/wp-content/uploads/2010/11/dummy.zip">Standard download link</a> | 
<a onclick="return disableDoubleClick()" href="http://shahinalborz.se/wp-content/uploads/2010/11/dummy.zip">Link with disabled doubleclick</a>

EPiServer CMS 6 Filemanager thumbnail bug

November 15th, 2010

In the Filemanager there’s a checkbox stating “Show thumbnails” which is supposed to show thumbnail images in the file list. We discovered that the images shown are in fact still full size.

I reported this tiny bug in the filemanager of EPiServer CMS 6 (6.0.530.0) a few days ago, and although EPiServer could reproduce it, I’m still confused by the fact that some websites with the very same version works, while others don’t.

Anyway, a quick-and-very-dirty fix for this is to modify [Program Files]\EPiServer\CMS\6.0.530.0\Application\UI\CMS\Hosting\Browse.ascx by adding
style=”max-width:60px; max-height:60px”
to the EPiServer:HostingThumbnailImage tag. Actually, that is pretty much what the CMS does when it works.

Reported as Bug #59137 – Thumbails in the Filemanager are normal size

* UPDATE *
This was actually NOT a bug in EPiServer, but (foolishly) a control adapter which was included in several projects (and I wasn’t aware of existed) that collided with the HostingThumbnailImage control inside EPiServer CMS. We solved this by inheriting EPiServer.UI.WebControls.ControlAdapters.HtmlHeadAdapter instead of System.Web.UI.WebControls.Adapters.WebControlAdapter in the custom image adapter.