John's profileJohn West Blogs about Si...PhotosBlogLists Tools Help

Blog


    6/30/2009

    Sitecore CMS 6.1 and OMS 1 Documentation

    In addition to releasing Sitecore Content Management System (CMS) 6.1 and Online Marketing Suite (OMS) 1, Sitecore today published new and updated documentation for both products. I updated my post that provides links to the best Sitecore documentation. I think the most significant changes include:

    Most other documents contain minor updates and corrections. As always, send corrections and suggestions to the documentation team using the email address listed in the footer of every page on the Sitecore Developer Network (SDN).

    6/13/2009

    Sitecore 6.1 Rules Engine and Conditional Rendering

    You’ve always been able to use code and configuration to control Sitecore behavior. Sitecore CMS 6.1, scheduled for release at the end of this June, 2009, includes a rules engine, allowing you to control Sitecore behavior through the browser-based user interface.

    The Sitecore rules engine supports the Online Marketing Suite (OMS), but also provides features such as conditional rendering. Conditional rendering allows you to define actions to invoke to control properties of each rendering dynamically bound to the page. You can use the rules engine to define other types of rules through the user interface, such as to control insert options, or to invoke specific operations after events on specific items, such as save or delete .

    The rules engine involves three primary concepts: conditions, actions, and rules. Like most concepts in Sitecore, each of these involves a definition item containing metadata.

    A condition definition item references a .NET class that contains a condition to evaluate, such as to determine whether an item is associated with a specific data template. Conditions define parameters, such as to allow the user to specify the data template. Sitecore provides a number of default conditions that you can use, such as checking whether an item is on the descendant-or-self axis of another item, or whether a specific field of an item contains a specific value. Of course you can implement custom conditions.

    An action definition item references a .NET class that contains an action to implement, such as to set the data source of a rendering. Actions define parameters, such as to allow the user to select the that data source. Sitecore provides a number of actions that you can use, such as hiding a rendering or adding a template to insert options. Of course you can easily implement custom actions.

    A rule definition item brings together some number of rules and actions, such as if the context item is on the ancestor-or-self axis of another item, then do not invoke a rendering. You have to define rules before you can use them. You can enter multiple conditions in a rule definition item (separated by “and” or “or”), , and you can select multiple actions to invoke when those conditions evaluate to True.

    The rules engine interface looks a lot like the Microsoft Outlook wizard for creating a rule, such as to move messages matching some criteria from one folder to another. You choose the conditions to evaluate and the actions that you want to invoke, and then enter parameters for both.

    You can see how Sitecore uses the rules engine internally by investigating the Rule field (a new data template field type in Sitecore CMS 6.1) in the Data section of the rule definition items beneath the /Sitecore/System/Settings/Rules item. For example, the /Sitecore/System/Settings/Rules/Insert Options/Rules/Conditional Renderings Conditions item defines that, when determining effective insert options for an item, if the selected item is a child of the /Sitecore/System/Settings/Rules/Conditional Renderings/Conditions item and is associated with the Common/Folder data template, then effective insert options should include the System/Rules/Condition data template:

    image

    In the first field of this user interface, you click conditions to add to the list of conditions to evaluate to determine whether to invoke the action(s). In the second field, you can select actions to invoke if those conditions evaluate to True. In the third field, clicking on any instance of the word “where” reverses the condition to “except where” – Sitecore applies the action when the condition is not true instead of when the condition is true. Clicking on the word “Conditions” allows you to select a parent item other than the /Sitecore/System/Settings/Rules/Insert Options/Rules/Conditional Renderings Conditions item (parameter of the condition and the action). Clicking on Folder or Condition allows you to select a data template other than Common/Folder or System/Rules/Condition (a parameter of the condition).

    Imagine a site in that consists of the home item (/sitecore/content/home) and its two children named A and B. All three of these items are currently associated with a single data template, and all use the layout details defined in the standard values of that data template. For the B item and all of its descendants, you don’t want to activate a rendering specified in layout details of the standard values of the data template.

    You could hard-code this logic in the rendering, or create a new data template inheriting from the existing data template, override standard values in the new data template, and change the data template associated with all of the items in the B branch to this new template. Or you could use conditional rendering features of the rules engine.

    To use the rules engine for this purpose, insert a conditional rendering rule definition item, and then edit the rule. The rule is blank by default:

    image

    The example rule applies to the B item and its descendants, so click “where item is a subitem of a specific item” condition to add that condition to the rule:

    image

    You could click the word “where” to reverse the condition to “except where”. The user interface displays the word “specific” is red to indicate that you need to enter a parameter value. Click the word “specific” to select an item to define that parameter (the B item):

    image

    The UI refreshes to show that the parameter definition. Now select the “hide rendering” rule to invoke that rule when the condition is true:

    image

    Actions can have parameters too, but this one doesn’t. This rule says that, before invoking any rendering associated with this conditional rendering rule, if the context item is B or a descendant of B, then don’t invoke that rendering.

    To apply the conditional rendering rule to all items associated with the data template, in the standard values for the data template, in layout details, in control properties for the rendering, select the conditional rendering rule:

    image 

    You can also configure global conditional rendering rules, that apply to all renderings, but too many of these could get expensive. The default global conditional rendering rule applies multivariate tests if multivariate tests are enabled, applying multivariate tests to all renderings for which the user has chosen to apply a multivariate tests. Multivariate tests basically vary the data source of the rendering using a .NET class to implement some randomization or other data source management strategy, which is really a form of conditional rendering.

    With the release of Sitecore CMS 6.1 and OMS 1, Sitecore will release documentation providing providing further details about the rules engine and conditional rendering.

    Update 30.June.2009: Sitecore today published the Rules Engine Cookbook, which also covers conditional rendering.

    6/10/2009

    Sitecore 6.1, the Page Editor, Edit Frames, and the Field Editor

    With all of the hype about the release of the Sitecore Online Marketing Suite (OMS) at the end of this June 2009, it’s important to remember that OMS depends on Sitecore CMS 6.1. This CMS release includes several useful new features:

    • Edit frames (described in this post).
    • The field editor (described in this post).
    • The rules engine (for features such as conditional rendering).
    • Parameters templates (for defining user interfaces to apply rendering parameters in layout details).
    • The Remember Me checkbox on the CMS login screen.
    • A reporting UI framework with some canned reports.
    • A variety of minor enhancements.

    This post describes two of these features that work well together: edit frames and the field editor.

    Sitecore 6.0 replaced WebEdit with the Page Editor. The Page Editor replaced content markers (green circles activating the Content Editor and context menus) with inline editing features that allow the user to edit directly in the page. It would not be possible for Sitecore to provide inline editing user interface components for every type of field. How would Sitecore know what user interface would make sense to change the value of a checkbox while inline editing on your Web site? What about your custom field types? So in the 6.0 Page Editor, you had to show the fields to edit certain types of data, or develop controls to let the user update those fields.

    Sitecore 6.1 introduces edit frames, which let you add menus of UI commands when inline editing in the Page Editor. 6.1 also introduces the field editor, which lets you edit fields using controls similar to those used in the Content Editor, but with a much more lightweight UI. You can use edit frames and the field editor to provide simplified editing for data template field types that don’t support inline editing.

    An edit frame creates something like an HTML <div> element around the enclosed components when the user is editing inline in the Page Editor. For example, I added a checkbox field named Boolean to the sample item data template and the following to the sample XSL rendering (of course you can do the same in .NET):

    <br />
    <br />
    <sc:editFrame>
      The condition is <xsl:value-of select="sc:fld('boolean',.)='1'" />
    </sc:editFrame>

    The result:

    image

    If the user hovers over anything in this <div>, the browser indicates the content enclosed in the <div>, and adds a control above the <div>:

    image

    If the user clicks the arrow in the control, the browser displays an edit frame menu, allowing the user to choose from Sitecore UI commands configured by an administrator:

    image

    Sitecore provides two default edit frame menu commands that you can use, and you can write your own. The Insert New edit frame menu command activates a user interface that allows the user to insert an item using the insert options defined for context item:

    image

    If the user creates an item, the Page Editor refreshes to that item:

    image

    The Edit Item edit frame menu command activates the field editor, and you can specify which fields to include. I specified my field named Boolean:

    image

    Just like after closing the Rich Text Editor, I have to save after changing any field in the field editor. Then:

    image

    The edit frame can contain any amount of markup, including inline editing controls for any number of fields, plus whatever other markup you enclose within the <sc:editFrame> element. You can have multiple edit frames on a page, each with different edit frame menu commands. You can implement your own edit frame menu commands, and of course use security to control access to edit frame commands.

    I was surprised at how easy it was to develop an edit frame menu command to list all fields in the item that don’t provide inline editing controls, excluding fields defined in the standard template.

    Sitecore will release this example as shared source when it releases Sitecore CMS 6.1. At that time, the Client Configuration Cookbook will describe edit frames and the field editor in more detail than this post.

    Update 30.June.2009: Sitecore today published the updated Client Configuration Cookbook describing edit frames and the field editor.

    6/1/2009

    Configuring a Sitecore Workstation Part 9: Issues I Still Have with Windows

    This post is the last in a series about Configuring a Sitecore Workstation. Previous post: Turn the System Over.

    I still have a few outstanding issues with Windows (or Microsoft maybe):

    • Windows sometimes loses local user profiles. It doesn’t lose the file systems, it just creates a new profile when the user logs in; browser bookmarks, quicklaunch icons, and almost all other settings are gone. I think this may be a sign that it’s time to rebuild Windows due to rot. Speaking of Windows rot, I think it’s best to rebuild a machine from scratch approximately every six months, at most once per year.
    • There’s an option in the Mouse control panel that causes the cursor to move to the default button when a new UI opens. It would be nice if there was an option to move the cursor back to where it was before the dialog opened (think about detaching multiple databases in SQL Server Management Studio). It would be even better if it had the intelligence to move the cursor to where the user is actually most likely to click in common dialogs including those in common applications.
    • Microsoft Live Messenger kept restarting itself, and configuring itself to restart when I log in, so I had to uninstall it.
    • There still seems to be a lot of software unavailable for 64-bit platforms and/or Windows 2008. There are hacks for some of it (such as Zune), but not others (for example, I seem to have to run a 32-bit browser to use Adobe Flash). It’s not clear to me why huge software companies like Adobe are having trouble with this transition.
    • Zune software is not available for all Windows editions, especially 64-bit. Zune is a Microsoft product and important enough to me that this deserves special mention. Ridiculous.
    • I might as well complain about Word too. Insert Cross-reference is one of the few Word features that I actually use. This dialog can show hundreds or even thousands of headings. Why doesn’t this dialog include a search feature? Why can’t I dock this dialog? Why do I have to resize this dialog from 426x338 every time I open it, when my monitor is 1920x1200? Why do I have to select the Heading Reference type every time I open this dialog?

    Configuring a Sitecore Workstation Part 8: Turn the System Over

    This post is part of a series about Configuring a Sitecore Workstation. Previous post: Configure a User Account.

    When turning a system over to a user:

    • Provide the bookkeeping department with a photocopy of the bottom of the machine with the owner’s username, the date, and the hardware order number written on it.
    • Ensure the time zone is set correctly for the user.
    • If time permits, defragment and check the hard drive for errors.
    • Eject any optical disk.
    • If the user has an Outlook archive, move it to their external hard drive, and add that archive file to Outlook. Otherwise, create an archive on the external hard drive.
    • Discuss spam subject headers and the Outlook accept/reject buttons with the user.
    • I tell the user they may need assistance installing the Outlook CRM client (avoid if possible), PDF writing software, phone software, configure gotomeeting with their account details, etc.
    • I honestly warn the user and ask them not to install anything, and even show Internet Explorer add-ins and AutoRuns to some of them.
    • I ask the user to install Microsoft updates after a few weeks unless they are informed not to, but to be careful to let the machine reboot completely whenever installing updates.
    • I warn the user to contact me if Vista decides it doesn’t like their license key, or if they have any issues with the system.

    At your discretion, on to the last post in the series: Issues I Still Have with Windows.

    Configuring a Sitecore Workstation Part 7: Configure a User Account

    This post is part of a series about Configuring a Sitecore Workstation. Previous post: Image the System

    Configure each user account as follows:

    • Where relevant, set the local username to the domain username, and the password to the domain password.
    • The password never expires.
    • Add the user to the Administrators and Remote Desktop Users roles.
    • Disable the Windows Welcome Center and the sidebar.
    • Select a screen saver and require a password on both resuming from the screen saver and waking from sleep or hibernate.
    • Show extensions for known file types.
    • Configure power settings such that the power button turns the machine off, the sleep button hibernates, and closing the lid does nothing.
    • ***JW: Create the VPN connection, configure Outlook, and confirm CRM access (not for administrators).***
    • ***JW: attach Outlook archive file, if any.***
    • On Windows Vista, Windows 2008, and presumably Windows 7, disable User Account Control.
    • For Vista, select Window Color and Appearance, and then select Windows Aero.
    • Disable the Language bar, the Windows Search Deskbar, and other useless features.
    • Configure Windows Taskbar and Start Menu Properties to show the quick launch toolbar and expand all menus.
    • Delete unnecessary desktop and Quick Launch toolbar icons.
    • Select the user’s time zone.
    • Check Autoruns, Internet Explorer add-ins, and services once more (see a previous post in this series, Configure Applications).
    • Empty the recycle bin and perform other cleanup operations as described in the previous post in this series, ***

    To configure Internet Explorer:

    • Add all local Web sites to the Trusted Sites zone in Internet Explorer.
    • Delete all browser bookmarks and bookmark folders.
    • Disable suggested sites.
    • Choose custom settings.
    • Download updates.
    • Disable accelerators.
    • Enable the SmartScreen (Phishing) filter.
    • Disable add-ins and toolbars, show small icons, and otherwise maximize screen space without hiding the status bar.
    • ***TODO: Protected mode? Tabs? Bookmarks? Trusted domains?***
    • Apply everything from the summary at http://sdn5.sitecore.net/sdn5/reference/sitecore%206/ie%20configuration%20reference.aspx. Specifically:
      • Install Adobe Flash (http://get.adobe.com/flashplayer/).
      • Install Windows Web Folders or the Windows Desktop Experience.
      • Add any CMS instances to Trusted Sites.
        • ***Sitecore specifics***
      • In regedit:
        • Create 32-bit DWORD HKEY_LOCAL_MACHINE\Software\Microsoft\Internet Explorer\Main\SessionMerging with value 0.
        • Create 32-bit DWORDs HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Internet Settings\MaxConnectionsPer1_0Server and MaxConnectionsPerServer with decimal values of 10.
      • Configure Trusted Sites:
        • Allow script-initiated windows without size or position constraints.
        • Allow websites to open windows without address or status bars.
        • Disable the pop-up blocker.
        • Disable the SmartScreen filter.
        • Enable programmatic clipboard access.
        • Enable launching programs and files in an iframe.
      • On the General tab:
        • Open popups in new windows.
        • Clear browser cache when Internet Explorer starts.
        • Delete browsing history on exit.
      • On the Advanced tab:
        • Enable script debugging (for developers).
        • Display a notification about every script error (for developers).
        • Disable reuse of windows for launching shortcuts.
        • Disable friendly HTTP error messages.
        • Empty temporary Internet files folder when the browser is closed.

    If time permits, defragment and check the hard drive for errors.

    I configure the following on my own systems:

    • Show notification icons and activity animation for all network connections.
    • Don’t hide inactive notification icons.
    • Select the maximum pointer speed under Motion on the Pointer Options tab in the Mouse control panel.
    • Firefox to prompt for a directory when downloading (Tools > Options > Main).
    • Configure Windows Taskbar and Start Menu Properties to show exclude Help and Support from Windows Start menu so I don’t click them by accident, and select small icons so I can fit more on menus.
    • ***JW: Additional task bar/start menu configuration***
    • After installing the touchpad driver, disable the touchpad (I use an external mouse if I can, or the pointing stick if I have to, so the touchpad just causes interference). I can also do without the mouse icon in the notification area.

    My Word configuration instructions may be a little detailed, but I write technical documentation for a living:

    • Copy templates to \Documents and Settings\<user>\Application Data\Microsoft\Templates or \Users\jw\AppData\Roaming\Microsoft\Templates.
    • Configure ALT-1 through ALT-4 to apply heading styles 1 through 4 (CTRL-ALT-SHFT-S, right-click, Modify, Format, Shortcut Key, Assign). I also use CTRL-T for typewriter and ALT-C for and ALT-T for fixed-width fonts (code sample and “teletype”).
    • Click the Home tab, then click Clipboard dialog launcher, and then click Options. Note that I am currently evaluating http://www.cybermatrix.com/cmdownloads.html). This is what I choose, but these settings seem to cause issues for applications including Windows Live Writer.

    image_thumb2

    • It might be more reliable to show these than to describe them. Click the Office button at the top left, and then click Word Options.
    • On the Popular tab, show the Developer tab and disable Full Screen Reading:

    image_thumb211[1]

  • On the Display tab, Show and print most hidden things, and update references whenever possible:

    image_thumb5

  • On the Proofing tab, enable grammar strict grammar checking:

    image_thumb18

  • Set AutoCorrect Options:

    image_thumb16

  • And the AutoFormat at As You Type tab:

    image_thumb141 

    • Still on the Proofing tab, configure Grammar checking:

    image_thumb211

    • Including Use of first person:

    image_thumb27

    • On the Advanced tab, don’t change Default paragraph style as I have done:

    image_thumb12

    • I no longer change the options for pasting with formatting, Instead, when I need to, I CTRL-SHFT-ALT-V to paste unformatted text.
    • Buy as many socks as possible of the exact same color and style. That way they’re much easier to match, and it doesn’t really matter when you lose one.
    • Speaking of Word, here are some keyboard shortcuts for features I actually use (and remember to click a tab to hide or show the ribbon):
    ALT Show keyboard shortcuts.
    CTRL-F Find.
    CTRL-H Replace.
    CTRL-A, F9 Update cross-references.
    CTRL-ALT-E Insert footnote.
    CTRL-SHFT-8 Show or hide formatting marks.
    CTRL-SHFT-ALT-S Show or hide styles.

     

    • Also, I typically do the following each time I open a document:
      • Show styles.
      • Hide the Properties pallet that Word usually opens.
      • When I insert the first cross-reference, I move and resize the dialog so that it fits below the styles I use without obscuring text. For Reference type, I select Heading. Then I leave this dialog open, so I don’t have to do the same again later. I leave each Word document open and save frequently so that I don’t have to reapply such preferences.
      • To find broken cross-references in the document, search for “Error! Reference source not found”.

    On to the next post in the series: Turn the System Over.

  •