Wednesday, July 12, 2006

First impressions..

Well, it didn't dissapoint me at all i have to say. 5.3 looks like it's going to be awesome. Had a bit of trouble installing it to my regular sql server, so for attempt #2 i went for the sqllite option instead and it works like a charm after setting a few additional security permissions. Don't know where to start really, so i'll just drop a few things on here for now. The layout of the content editor is heaps better than 5.2. no more waste of space here, in fact, it's quite clever how they've managed to squeze so much information and still keeping it easy to access. Working with this editor will make us, and clients, save a lot of time. Also, on the note of the content editor: it's fast. way faster than the one in 5.2. Probably for the above reason alone i'd jump at the chance to upgrade everything we have to 5.3, but that'll have to wait until a full version is available and we're asked to upgrade :) Some other things that jump at you right away: There's now an easy way to set SubItems Sorting of an item, very neat & useful. Validation is also very easy to access and will make clients happy indeed. Even Icon assigning is made easy with new panels showing the icons and smart positioning. The Developer Center is an interesting idea, and can indeed prove useful in the future, but i hope it gets a bit more options to it, or a way to easily define your own custom options without stepping into the code. The idea is great tho, gathering common things under one umbrella. The Template Editor has also gotten a big overhaul and i can't say i'm sorry for that. The new one is great and will also make working with it a lot easier. Things like setting Standard values and Masters are neatly accessible now. Also, the way you can add things to the template and edit the template from the content editor is quite cool. I hate to sound like an evangelist, but it's hard not to. It's awesome. So it's still a Beta version and has it's share of bugs, but i'm impressed, and that doesn't happen very often. Hat's off to the team at Sitecore, this version will shake the foundations of CMS systems for a long time. Haven't yet written a portal for this version, but that's probably going to be tonight then since i can't sleep in this heat. Don't get me wrong tho, summer is heaps better than the cold of winter, but i wouldn't mind having a full nights rest every now and then.. oh well.. more updates later..

Monday, July 10, 2006

5.3 Beta

Well, it's here, the beta release of v5.3. Time to see if it lives up to my expectations or not, but something tells me it will.. and more. For those of you with access to sdn5 and curiosity to satisfy, run on over there and download it..

Friday, July 07, 2006

5.3 - Follow Up

Lars Nielsen at Sitecore just made my day (and, seeing that it's friday today it couldn't have been done much better), so, i reckon i'll have to have a beer later in his honor. My plans for a few days of r&r (some call it vacation, but i think vacation is when you have to much time on your hands to know what to do with) are safe and in no apparent danger. Quick thing about portlets: if you've ever added a contextmenu to a listview in the xaml itself and then used it, you'll notice it magically vanishes after the list is refreshed. well, there's a work-around for that as well. Assuming the code looks something like the following:
protected Listview BudgetList; // more nice stuff that you're using.. protected override void OnLoad(EventArgs e) { base.OnLoad(e); if (!Sitecore.Context.ClientPage.IsEvent) { // some code here to load it all if you have any.. } }
All you'll actually really have to do here, for now (i'm sure it'll be fixed and even improved by the rate they're developing) is to add one line to the OnLoad() event:
protected Listview BudgetList; // more nice stuff that you're using.. protected override void OnLoad(EventArgs e) { base.OnLoad(e); if (!Sitecore.Context.ClientPage.IsEvent) { BudgetList.ContextMenu = "show:BudgetContextMenu"; // some code here to load it all if you have any.. } }
(sorry for the crappy layout of the text, don't really have the time to edit it properly).

Thursday, July 06, 2006

5.3

Everything i've read, seen & heared about v5.3 is a step forward. It's going to be faster, better & smarter. Things are going to work better in regards to user experience. I could go on & on about all the benefits, but that'd probably be like preaching to the choir so i won't do that. There's one thing that cought my eye tho, and that one thing has me pinned against the wall:
Sitecore’s portal framework is replaced with the ASP .NET 2.0 embedded portal framework.
Perhaps for many a minor thing that'll pass without much notice, but right now that same change/update/migration, if it won't support the previous portal, only says one thing to me: cancel any upcoming vacations..

Wednesday, July 05, 2006

Internet Explorer Developer Toolbar

If you haven't tried it yet, give it a shot. Quite neat application that can prove useful when developing websites and solutions for the web in general. Some of the features: View DOM, Disable Cache/Images/Css etc, Outline Div/Table/Images etc, Resize, Clear cache for domain/all etc and a ruler. http://www.microsoft.com/downloads/details.aspx?FamilyID=e59c3964-672d-4511-bb3e-2d5e1db91038&DisplayLang=en Update: If you're a heavy firefox user, go get Firebug for firefox at https://addons.mozilla.org/firefox/1843/ which offers the same functionality (if not better) for Firefox. Thanks crashie!

Get children sorted from a specific Item

Often you get stuck with things you don't want to do again and again, one of them is to bang your head against the wall trying to figure out where you wrote a icomparer that you can easily use to get a sorted ChildList. Well, after banging my head enough i wrote a small workaround using a DataContext instead. The method is pretty straight-forward, so just use it as it is or modify it to any need.
private Sitecore.Collections.ItemCollection GetChildrenSorted(Item parent, String sortby, bool sortascending, int offset, int range, string filter) { Sitecore.Web.UI.HtmlControls.DataContext dc = new DataContext(); dc.DataViewName = "Master"; return dc.DataView.GetChildren(parent, sortby, sortascending, offset, range, filter); }
So, whenever you need to get a list of items sorted a specific way just use the method in the appropriate way, maybe like the example below?
private void FillSomeListOrSomething() { // Parent Item that you want to get the children from.. Item parent = Sitecore.Configuration.Factory.GetDatabase("master").Items["/sitecore/content/home"]; if (parent.HasChildren) { foreach (Item itm in GetChildrenSorted(parent, "__created", false, 0, 0, "")) { // whatever you want to do with the sorted list of items you got back.. } } }
Maybe this is a really bad way to approach this problem, but it works for me so i'll use it for now (or until this functionality is implemented in Sitecore).

Tuesday, July 04, 2006

Problem with DataTreeview & DataContext in a portlet

If you've ever tried writing a portlet containing a DataTreeview & DataContext with the normal DefaultPortletWindow control you've probably noticed that it doesn't work all that well (surely will be fixed in a later release we hope). The problem is that you when you try to expand a node in the DataTreeview you get an error saying DataContext ”” not found. (Method: Sitecore.Web.UI:HtmlControls.Treeview.Toggle(String id)). For anyone that has actually been affected by this issue or will be in the future, there are two ways to address this issue, either programmatically or via a work-around. The programmatical approach for this by issue would be to implement all of the code relating to the DataContext and DataTreeview and, for ex, adding it to a Border control or similar in your C# code. This solution though isn't that friendly to use again in another portlet since it involves you writing all the code for yourself. The work-around is a lot more user-friendly and a solution you might want to adapt instead of writing the same code over and over again each time. In this case, all you have to do is copy the PortletWindow control, rename the control to something else, like myPortletWindow, and save it with a new name where your custom controls are located. After that, apply the new window control to your portlet xml layout replacing the standard one, and save. So, step by step: 1 – Open PortletWindow control (located at \sitecore\shell\Controls\Portal\Portlet window.xml) 2 – Change the name of the control to something else (in this case myPortletWindow) 3 – Save it somewhere (in this case I’m saving the controls under \sitecore modules\Shell\Example\Controls) 4 – Apply the new window control to the portlet xml layout that you had trouble with and save it Once you've done this you can use this window control instead of the default control without further need to manage it programmatically.