Sitecore CMS and everything related RSS 2.0
 Monday, May 14, 2007

Google analyticsOur google analytics account has been upgraded to a newer version, as any data junkie I'm wondering around looking here and there. I must say it looks nice, has all the fancy sparklines, etc.

Some stats on browser usage (last week):

Internet Explorer: 70%
Firefox: 24%
Safari: 2.5%

Internet explorer versions:

IE 7.0: 57%
IE 6.0: 42%

Monday, May 14, 2007 11:21:58 AM (FLE Standard Time, UTC+02:00)  #    Comments [0] -
Web development
 Friday, May 11, 2007

<!-- HTML EDITOR LINE BREAK
Specifies the tag that the HTML editor inserts on Enter. Values can be
"br", "div" and "p".
-->
<setting name="HtmlEditor.LineBreak" value="br" />

HtmlEditor.LinkBreak is one of those settings you should know about. By default it's set to 'br', which means that every time editor presses Enter in Sitecore Content Editor, a '<br />' tag is inserted.

I think it's wrong - isn't the enter button supposed to start a new paragraph? Changing the setting to "p" gets you there. Shift+enter, on the other hand, does the line break - here goes the <br /> tag.

Here is the difference between two; first, the default br setting:

Paragraph 1 [click enter]
<br />
Paragraph 2 [click enter]
<br />
..

Changing it to p:

<p>Paragraph 1 [click enter]</p>
<p>Paragraph 2 [click enter]</p>

It is semantic html, it feels right and is easier to style, even if you're not concerned with standard compliance. I wonder if there is still a compelling reason to keep having <br /> as a default?

Friday, May 11, 2007 9:48:27 AM (FLE Standard Time, UTC+02:00)  #    Comments [5] -
Sitecore
 Thursday, April 12, 2007

Most methods in XslHelper are virtual, so it's possible to tweak the output of sc:something() functions and <sc:something /> controls in XSL renderings. To change the behaviour of all renderings in Sitecore solution, modify the sc xsl extension registration in web.config:

<xslExtensions>
  <extension mode="on" type="Sitecore.Xml.Xsl.XslHelper, Sitecore.Kernel" namespace="
http://www.sitecore.net/sc" singleInstance="true" />
  <extension mode="on" type="MyNamespace.MyClassDerivedFromXslHelper, MyAssembly" namespace="
http://www.sitecore.net/sc" singleInstance="true" />

To use the derived extension selectively, just register it as a new xsl extension.

Note that it's a fairly crude hack probably involving some string manipulation, but as such it can also help when other methods fail.

Wednesday, April 11, 2007 11:00:43 PM (FLE Standard Time, UTC+02:00)  #    Comments [2] -
Sitecore | XSLT
 Thursday, April 05, 2007

Today's post shows how to add Default Layout to your Sitecore devices. This can be handy if you don't want to tediously update multiple templates / items just to configure the same layout for the new device over and over.

A good example of that is enabling RSS output for every item: it's natural to use a separate device/layout for that, but the layout is the same for all items in the solution. So instead of modifying templates and items, httpRequestBegin pipeline processor is used:

public class DefaultLayoutResolver
{
  private static readonly ID xmlLayoutID = ID.Parse("{8CF08867-5789-40CA-A0A4-01D059E50E11}");

  public void Process(HttpRequestArgs args)
  {
    if ((Context.Device != null) && (Context.Device.Name.ToLowerInvariant() == "xml") &&
     (Context.Item != null) && (Context.Item.Visualization.Layout == null))
    {
      LayoutItem layout = Context.Database.Items[xmlLayoutID];
      if (layout != null)
      {
        Context.Page.SetLayout(layout);
      }
    }
  }
}

Add the processor right after the standard Sitecore LayoutResolver processor, so that Sitecore configuration takes precedence.

The same code is reused in Printers Inc to output raw item XML. For more flexibility, you can add the "Default Layout" lookup field to a device template and modify the DefaultLayoutResolver to read that value.

Thursday, April 05, 2007 11:21:24 AM (FLE Standard Time, UTC+02:00)  #    Comments [0] -
Sitecore
 Wednesday, April 04, 2007

Sitecore has two kinds of item XML representation, or flavors if you will.

Serializer XML is the heavyweight format, containing everything Sitecore needs to know to get the item from one solution and paste into other: all attributes, field values in all versions and languages. It is used by the packager.

To get serializer xml programmatically:

item.GetOuterXml(deep);

XSLT XML is the internal interpretation that is fed to XSL renderings (tranformations). This is the lightweight brother, containing only item attributes and field ids. No field values, only the current version and language. You would want to know how it looks like if you code XSL renderings.

To get XSLT xml programmatically:

ItemNavigator navigator = Factory.CreateItemNavigator(rootItem);
writer.Write(navigator.OuterXml);

 

In the next (3.0.13, soon to be released) version of demo site, we have added the option to output item XML in both flavors to demonstrate what it feels like:

http://<demositeurl>/?xml=    => Serializer XML flavor of the current item (no children)
http://<demositeurl>/?xml=&deep=true    => Serializer XML flavor of the current item and all descendants
http://<demositeurl>/?xml=&xslt=true    => XSLT XML flavor of the current item and all descendants (always 'deep')

Thanks to John West for the idea.

Wednesday, April 04, 2007 3:13:07 PM (FLE Standard Time, UTC+02:00)  #    Comments [2] -
Sitecore | Demo site | XSLT
 Tuesday, April 03, 2007

Dmitry, Yan and I are in Copenhagen April 16-20; looking forward to that.

Tuesday, April 03, 2007 7:24:44 PM (FLE Standard Time, UTC+02:00)  #    Comments [0] -

I'll probably be the last one to point out that the Sitecore 5.3.1 is out: check out Peter's series of posts on new features. What I can add is that our www.sitecore.net is also updated from the Sitecore 5.2 it was originally built on, the media content is moved to the database, all of the fancy stuff.

The migration went fairly painful, although I must admit it does help to have the mastermind of the whole migration framework sitting nearby. Thanks Sergey!

Tuesday, April 03, 2007 6:55:55 PM (FLE Standard Time, UTC+02:00)  #    Comments [0] -
Sitecore | 5.3
 Thursday, March 22, 2007

If your site can be run in disconnected mode (like our printers demosite during some demonstrations), google analytics javascript errors can be annoying. Here's how to avoid them:

if (typeof(urchinTracker) != "undefined") {
  urchinTracker();
}

This way it works just fine in connected mode, and quietly fails when internet connection is not available.

Thursday, March 22, 2007 5:26:18 PM (FLE Standard Time, UTC+02:00)  #    Comments [0] -

 Wednesday, March 21, 2007

The Email Alert add-on allows the visitors of a web site to subscribe to different areas of interest and receive a notification when a certain article is updated.

Email alert will be included in the next build of the SC Printers Inc demo site, and below is the quick installation walkthrough. The module requires Sitecore MailingList to work, so I assume you have it working (i.e. the mails are sent out OK)

Install the package

Download and install the package, update configuration according to readme.

Define target groups

The package will install /sitecore/content/Target Groups branch. We want the users to be able to subscribe to news and product areas; it should be possible to subscribe to monochrome and color laser printers separately. With that in mind, define the following structure instead of the sample one:

Target Groups branch

Update site templates

Next we need to update templates of the product and news items; add /sitecore/templates/Email Alert system/EmailAlert.Target Groups template as a base template to Product and News item templates:

Base templates of the product template

This will add the Target Groups field to products and news.

Bind items to target groups

Now when relevant templates have the Target Groups field included, use it to define relationship between items and target groups.

It's simple for news: find the News Item template, and edit the standard values so that 'News' checkbox is checked in target groups field:

News standard values: target groups field

Because products have two separate branches (monochrome and color) that are based on the same template but should belong to different target groups, we need to set the checkboxes manually:

Laser printers content branch

Then update product masters to make sure that new items are automatically set up in future.

Add the subscription page

The subscription page will allow extranet users to subscribe to target groups they are interested in.

Email alert installs a sample 'Subscribe' sublayout. Pick a page and setup presentation to add the sublayout:

Adding subscribe sublayout

With Printers Inc, the page is tweaked to match the site design and the ability to create new users is removed:

subscription control

Now extranet users can use the page to subscribe to one or more topics.

See it working

Now the module is finally set up. Next time editor wants to update the product, she opens Content Editor, updates some details:

Content change: "updated with new information"

and then clicks save:

Comment pop up

Because laser printers are watched by email alert, comment notification pops up and editor enters a brief description of the change.

Nothing happens until the product is published; after the publish email agent kicks in and sends notification emails to all users subscribed to particular target group (Product -> Laser):

EmalAlert notification email

The templates are customizable at /sitecore/system/modules/EmailAlert/Settings.

Wednesday, March 21, 2007 3:35:44 PM (FLE Standard Time, UTC+02:00)  #    Comments [0] -
Sitecore | Demo site
 Friday, March 16, 2007

sdn5.sitecore.net is now also known as sdn.sitecore.net. Developer Network for Sitecore 4 is available at sdn4.sitecore.net.

Friday, March 16, 2007 6:19:41 PM (FLE Standard Time, UTC+02:00)  #    Comments [0] -

Archive
<May 2007>
SunMonTueWedThuFriSat
293012345
6789101112
13141516171819
20212223242526
272829303112
3456789
Blogroll
 Alex de Groot
Few words about SiteCore from Holland
 Alexander Shyba
Sitecore Support
 Anders Dreyer
Anders Dreyer on Sitecore Development
 Jakob Christensen
Sitecore Core Development
 Lars Fløe Nielsen
Lars's ramblings about development and business processes
 Ole Thrane
Sitecore API
 Runi Thomsen
Runi Thomsen Sitecore Toughts
 The Sitecore Experience
The Sitecore Experience
About the author/Disclaimer

Disclaimer
The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

© Copyright 2008
Alexey Rusakov
Sign In
Statistics
Total Posts: 199
This Year: 49
This Month: 3
This Week: 0
Comments: 0
Themes
Pick a theme:
All Content © 2008, Alexey Rusakov
DasBlog theme 'Business' created by Christoph De Baene (delarou)