Quantcast
Viewing all articles
Browse latest Browse all 10

Obscure Sitecore Features, inspired by Julian’s Flight Simulator

To the untrained eye, this blog might look a little neglected when really it’s just been taking a hiatus from publishing blog posts. More regular updates are around the corner including a project I’ve wanted to finish for almost six months.

In the meantime, I wanted to highlight an excellent blog post by Julian over at Igloo.

I’ve worked with Julian twice before and now for an account at Reactive we’re working together to create an SVN masterpiece that will allow two separate development teams to compete directly to create code conflicts. You can follow Julian on Twitter.

 

Image may be NSFW.
Clik here to view.
Microsoft Flight Simulator 9/11

This is Julian’s screen most days


Around June, Julian took a break from playing Microsoft Flight Simulator and wrote a blog post about some useful but obscure features of Sitecore. Only coming across it last night, I notice that it’s only be re-tweeted five times which is a shame because it’s really useful.

The Gloo: Top 5 Obscure Sitecore Features

Hopefully this blog post and my excessive use of WordPress SEO plugins will help generate some more views for this piece. A couple of the most interesting for me were: BulkUpdateContext; is a must-have for anyone who is doing content migration using Sitecore and the third (UrlString Class) is something I’ve used before, but like many parts of the Sitecore API, aren’t widely known.

Not sure if I can come up with five of my own but here’s a couple, perhaps not-as-obscure features.

  1. Developer Center: XPath Builder: hardly obscure you might say but the number of certified developers I’ve come across who didn’t know it existed is surprising. In the CMS, open the menu and run Developer Center, when it loads click  Tools > XPath Builder from the menu.
    Image may be NSFW.
    Clik here to view.
    XPath Builder

    This tool allows a developer to test Sitecore XPath queries in the CMS against the database, these queries can then be used by the Sitecore.Data.Database methods: SelectItems, SelectItemsUsingXPath, SelectSingleItem and SelectSingleItemUsingXPath. The Sitecore Developer Network has an excellent reference on using Sitecore Query, you’ll need an SDN login to view it.

    Besides from testing query syntax, it’s also a useful way to compare query:/ vs fastquery:/ speeds.

    Here’s a basic rundown of the fields in XPath Builder:

    • Context Node: the node from which the query will be executed, this can help you test ancestor and descedant queries
    • Database selector: choose to run the query against core, master or web
    • XPath Expression: enter a Sitecore Query using query or XPath notation
    • Result: returns the results of the query (or any error messsages). The number of items returned is limited by web.config setting Query.MaxItems
  2. Utility classes in the root Sitecore namespace: they can be easy to miss if you’ve never looked in the Sitecore namespace or the documented API before, here’s a rundown of a few that I’ve found useful in the past:
    • Sitecore.Constants: system-wide constants, far too many to describe here but I’ve no doubt many places/developers have coded their own ways to get these values
    • Sitecore.DateUtil: Sitecore stores all datetimes in ISO format “yyyyMMddTHHmmss”, this class contains methods to convert this string to and from .Net’s DateTime type
    • Sitecore.DaysOfWeek enum: pretty straight-forward
    • Sitecore.FieldIDs: a static class for holding well-known GUIDs relating to template fields, useful for API work on Templates
    • Sitecore.ItemIDs: a static class for holding assorted well-known GUIDs, for example the ID of the Layouts root folder or the Templates root folder
    • Sitecore.MainUtil: far too broad to describe in detail but here’s a few functions included you may have coded yourself in previous Sitecore projects: ColorToString, CombineArrays, DecodeName, EncodeName, SendMail (uses SMTP settings from the web.config).
    • Sitecore.StringUtil: utility functions for string manipulation
    • Sitecore.TemplateIDs: (really, really useful) a static class for holding well-known GUIDs relating to core Sitecore templates, i.e. Command, Folder, Image, MediaFolder and many more.

    Details of all these classes and more are available through SDN, especially useful in Windows Help format for the entire API as part of the documentation package.

Finally, just to continue the gaming-related private jokes…

 

Image may be NSFW.
Clik here to view.
Nice ass Jules

This is what will happen if Igloo commit code that breaks the build


Viewing all articles
Browse latest Browse all 10

Trending Articles