Archive

Archive for October, 2010

The Customized Startbar Module

October 17, 2010 Leave a comment

A little while ago I blogged about how to tweak the startbar in the Sitecore desktop to always display the database name. The issue with the current way in which Sitecore shows the database name is that it puts it on the desktop surface, so it can be obscured by application windows.

And the issue with my little tweak was that it was incompatible with the Quicklaunch Toolbar shared source module I wrote a few years ago, that I almost can’t live without on all my Sitecore projects. Not the concepts, but both the module and the tweak required overriding the startbar sheerUI control. So I had to add the database name tweaks into the quicklaunch toolbar module. But with those additions I don’t think the name of the module was appropriate.

And so I created the Customized Startbar module which you can find at http://trac.sitecore.net/CustomizedStartbar/. This module contains the database name tweak and the quicklaunch toolbar. And the appropriate naming of the module now paves the way for any other tweaks anyone might come up with.

Customized Startbar 2

Enjoy!

Categories: Sitecore

Sneak Peek at Sitecore 6.4

October 13, 2010 11 comments

I was lucky enough recently to get my hands on a QA build of the up and coming Sitecore 6.4. And I’ve got to say, very nice. The improvements made in this release are very apparent and it shouldn’t take a great deal of persuasion to get your clients to upgrade, especially if they’re currently using the page designer.

So here’s a highlight list of the improvements in Sitecore 6.4.

Cross Browser Support

The very first notable improvement is when you navigate to the login page in a non-IE browser such as Firefox, Safari or Chrome. The desktop is finally available in all (well, those I tested anyway) browsers. This is fantastic news for both devs and users. Not only because you’re now not forced to use a lesser browser when you want the desktop, not only because you no longer must have a PC to use the desktop, but mostly for the performance. Sitecore has a very rich UI which contains a lot of javascript and pretty much every single javascript engine in every non-IE browser is faster than the engine in IE. Chrome has long touted being the fastest javascript engine, and now you can take advantage of that capability in the Sitecore desktop.

sc64_login_chrome

The login page in Chrome. Note that the desktop option is available (no hacks!)

sc64_desktop_chrome

The desktop, in all it’s glory, inside Chrome.

This cross browser support has come at a cost though, we’ve lost support for IE 6. But you know what? Let it go. I applaud Sitecore for dropping support for possibly one of the worst browsers to pollute the web space for so long. If you still use IE 6, then you don’t deserve a good browsing experience. Just let it die.

Updated WYSIWYG editor

The WYSIWYG editor has also been updated from the previous Telerik ASP.NET RAD editor to the latest Telerik ASP.NET Ajax RAD editor. This is definitely good news for both developers and users. I say developers here cause it was normally their job to go and fix any suspicious markup the WYSIWYG editor was producing.

Having said that, the previous editor did a pretty good job especially when compared to any of the other editors out there on the market. But the new Telerik RAD editor, also sometimes referred to as the Telerik “Promethius” RAD editor does an even better job.

Why is WYSIWYG so important? On every single tender I cast my eyes over there are always requirements to do with the WYSIWYG editor, which is kind of funny seeing as though the editor is an external 3rd party component. But this is how business users are going to express themselves. And don’t marginalise the importance of a good WYSIWYG editor. WYSIWYG is an extremely difficult feature. If it weren’t difficult we’d have had perfect WYSIWYG editors on the market years ago.

And there’s also the issue of compliant output. More and more clients are aware of the importance of having a site with compliant markup. The new editor does a better job at this than the previous editor.

Unified Page Editor

The Page Editor and Page Designer have also had an overhaul and been merged together. This new page editor is called the “Unified Page Editor” but is still referred to in the CMS as the “Page Editor”. This feature was originally demoed at Dreamcore this year. Unfortunately I didn’t make it to Dreamcore, so I hadn’t seen this merged interface before I started playing with Sitecore 6.4.

The ribbon displayed at the top of in-page UIs (page editor, preview editor, debugger) has also had a makeover to give it a much more clean feel. I never thought there was anything wrong with the previous ribbon displayed in-page, but this new ribbon just looks…better.

experience_editor

You can still edit content in the page editor as you used to; hovering around the page would reveal editable content by placing a border around it. But this has now been taken a step further by combining all the designing features into this view as well, so whilst hovering you don’t just get borders around editable content, you also get borders around placeholders and controls you can interact with. Of course these features are security enabled so if you don’t have editing or designing permissions, then you wouldn’t see the relevant borders or be able to edit / interact with the relevant content / controls. If you do have permission, you may still want to turn off one or the other (content editing or designing) so you can focus on the task at hand.

When you want to insert a new control (rendering or sublayout), clicking the rendering button in the new chunk on the home tab will reveal the placeholders in the page where your new control can be added.

sc64_insert_control

Clicking on the appropriate “add here” button will open a selection dialog where the user can select the control to insert. Only the appropriate controls are displayed in the dialog, according to the relevant placeholder settings which have been configured for the placeholder. The controls in the selection dialog also now support being displayed in a thumbnail view where user defined thumbnails for each control are displayed. (a little more on that later).

 sc64_insert_control

There is also now an option to configure the control to request a data source be defined by the user when they add the control to the page. This is done through another dialog which allows selection of an existing item or creation of a new item.

sc64_select_datasource

This dialog can also be configured to only allow selection of items based on specific data templates.

Delta Presentation

Now all this page designing used to lead to a big problem. When an item’s presentation was designed using the page designer the presentation was saved to the item being designed. Best practises are to specify item presentation on the data template’s standard values. In this way all items based on that data template will inherit the same presentation and will appear the same. But with presentation defined on an item directly, any update to the standard value will not be reflected in the item.

Incidentally this is also the case with some other Sitecore modules such as the WebForms for marketers module; when a user adds a form to a page the presentation is updated to include the WebForms interpreter control, thus any changes now to the template standard values presentation are not inherited.

Sitecore 6.4 has solved this issue. When a user designs a page and clicks save, only the changes to the template standard values presentation are stored in the __renderings field of the item. This field is merged with the template standard values at runtime to give the overall presentation for that item. This is fantastic! This means even after a user has designed a page changes to the template standard values presentation will be reflected in the designed items cause they no longer store the complete presentation for the item.

All this magic is done under the covers. So if you update the presentation of a content item programmatically, as long as you use the LayoutField custom field to access the __renderings field and set your updated presentation through the Value property of the LayoutField custom field, Sitecore takes care of generating the delta presentation and storing that against your item. Hopefully this means any existing modules (WebForms for Marketers, etc) will gain this feature when used in Sitecore 6.4, and if they don’t it’s quite a minor update to allow it.

I know this is a new feature and Sitecore are just focusing on getting it out there, but one thing I’d like to see is full support for delta presentation through data template inheritance, which would finally fulfil a feature from my Sitecore wishlist that I blogged about a while ago: http://adeneys.wordpress.com/2008/12/17/my-sitecore-wishlist/.

There doesn’t appear to be an option in the page editor to store the presentation in template standard values but you can quite easily in the content editor use the “copy to” link in the presentation dialog box to copy the delta presentation back to the template standard values. Luckily this copy doesn’t just copy the delta, but the complete definition with the delta changes merged into the presentation from the template standard values.

This also means you can’t use the “copy to” link to copy the delta presentation between items. So if a user designed a particular page and wanted to repeat that presentation on several but not all pages, they would have to design each item in turn. I would love to see Sitecore provide some more tools to support this kind of thing.

Thumbnail Creator

Sitecore has always been quite a visual system in the sense that they understand the power of icons. People can recognise icons and pictures much quicker than they can read text, so when scanning through a list of items it helps greatly if you have different icons displayed next to each option than just plain text or the same icon.

Sitecore 6.4 adds a “thumbnail” field to all items which is displayed in place of the item’s icon in particular lists. One example is the rendering selection dialog shown above. Sitecore also understands that the process of generating thumbnail images for a large number of items can be quite time consuming and cumbersome. So in Sitecore 6.4 they added a thumbnail creation wizard.

Now this feature almost feels superfluous. It’s like the powdered sugar on top of the cherry on top of the cake. This wizard allows selecting an item from the content tree or specifying a URL, taking a screenshot of it and presenting it to the user to allow them to drag a cropping square around the page and define which portion to use for the thumbnail. OMG! You would never expect something like this in a web application.

Here’s what the new thumbnail field looks like (which is of field type thumbnail).

sc64_thumbnail_field

And here’s the thumbnail creation wizard in action.

sc64_thumbnail_creation_wizard

Item Clones

A brand new feature in Sitecore 6.4 is item clones. These are provided as a replacement for proxy items and are used to share content around the content tree. They make use of the standard values architecture to inherit their field values from the original item.

Item clones are created inside the content editor and are very straight forward to create. You can even clone clones.

An advantage to using the standard values architecture for item clones is that you have the opportunity to override values from the original item on the clone item. So we now have an extra link in the standard values inheritance chain, from base templates, to item’s template, to item to clone. And when the original item is updated those updates are flagged on the clone item and must be accepted before the clone item takes on those values. Clones also work on subtrees, not just single items.

sc64_clone_updated

Note in the above screenshot the notification in the quick action bar indicating the clone items and also the warning in the fields section that the original item has been updated.

Clones can also be broken by using the unclone command on the ribbon. When this button is clicked the cloned item becomes a real normal item. It will simply no longer inherit it’s values from the original item. And if you try to delete the original item the same thing happens; the clone items become real items with their current field values.

I think item clones will open up a while new box of tools for content sharing strategies. But don’t fret about losing proxies just yet. They are deprecated in Sitecore 6.4 but haven’t been removed just yet.

Conclusion

Although the CMS 6.4 release only contains a few extra features, they are quite high value features that will add a lot to any site and make the lives of the developers maintaining them much easier. I for one am quite excited by this release and can’t wait to start building sites with it.

Categories: Sitecore

Configured Dictionary Being Ignored

October 12, 2010 5 comments

I recently ran into an issue with Sitecore where the dictionary I’d configured for a language was being ignored. Whenever you create a new language in Sitecore a language definition item corresponding to the language is created at /sitecore/system/Languages/[language code]. One of the fields of this language definition item is “dictionary” and is filled in with the filename of the TDF file used by the Telerik editor to perform spell checking in rich text fields. The issue was Sitecore was ignoring this field value and using a different dictionary. I could see this issue because no matter what value I put into that field a US English dictionary was always used to spell check the rich text fields.

The reason this issue came to light was that I was trying to configure Sitecore for the Australian locale. I did this by:

  • Change the flag icon for the default en language from American to Australian
  • Configure the DefaultRegionalIsoCode setting in web.config
  • Change the dictionary value for the language definition item to en-AU

But it would appear changing the dictionary field has no effect. Sitecore was ignoring that value and instead tried to load an appropriate dictionary for en.

The default en language in Sitecore is a neutral culture meaning it doesn’t define a region and doesn’t define region specific formatting rules for numbers and dates. For example, in Australia dates are formatted dd/MM/yy whereas in America dates are formatted MM/dd/yy. Both cultures speak English though (albeit slightly different spelling rules (color vs colour)).

So Sitecore can do things like format dates, etc it requires a specific culture. The .net framework exposes a method on the System.Globalization.CultureInfo class called CreateSpecificCulture. You can pass a neutral culture to this method and .net will look up for the first installed language on the system which has the same language as the neutral one requested. In most cases for en this will be en-US.

So the rich text editor field was loading a dictionary based on the current language name, en, which resulted in the US English dictionary being loaded. I logged this issue with Sitecore support and they’ve confirmed it as a bug. This is good cause it means Sitecore should be fixing the issue, hopefully quite soon.

There are a few workarounds for this issue.

  1. Contact Sitecore Support for a workaround. They provided it to me and I know of at least one other SDN Forum user who also received the workaround.
  2. Rename the dictionary file to en-US.tdf (not desirable as it means you won’t be able to spell check in US English)
  3. Configure the correct specific language in Sitecore before you start content authoring.

The third workaround above isn’t likely to happen as by the time you’ve realised there is an issue with the spell checking dictionary you’ve likely already created some content. So I got to wondering if I could use Revolver to migrate my existing en language content to the new specific language I created?

Revolver contains the cpl command (copy language) which is used to copy content between languages. I could easily couple that with a find command to traverse every single item in the system and copy the content over. I could then hopefully delete the default en language.

This may also be desirable for those that never enter English content into their websites. For example, if I were in Italy creating an Italian only site, what’s the point of having this English language hanging around?

But I thought I should test this idea to make sure it worked. I grabbed an existing Sitecore 6.3 install I had hanging around, added the en-AU language then executed the following command in Revolver to copy all the content from en to en-AU.

find -r (cpl en-AU)

I also threw a timer around that to see how long it would take.

timer (find -r (cpl en-AU))

For the master DB containing 2086 items this took 132 seconds. But the real test here is to see if I can now delete the default en language and have Sitecore work properly.

So off to the control panel I go to delete the en language…and everything appears to be working properly. Just remember to set your site’s language or the DefaultLanguage setting in web.config.

Categories: Revolver, Sitecore
Follow

Get every new post delivered to your Inbox.