Escape characters/words in a Sitecore query
There are a few characters and words you need to escape while using Sitecore query. You can escape special characters wrapping them in a #. For example a hyphen in a query needs to be escaped.
Example
string query = "/sitecore/content//*[@#site-title#=’Example Value’]";
In the previous example we use the single quote (‘) to wrap the field value. Using a single quote in the field value will break the parser. At this point you can use an escaped double quote to wrap the field value containing the single quote.
Example
string query = "/sitecore/content//*[@#site-title#=<strong>\"</strong>It’s great<strong>\"</strong>]";
There is also a list of words that needs to escaped when used in the path (before //*), there words are :
- ancestor
- and
- child
- descendant
- div
- false
- following
- mod
- or
- parent
- preceding
- self
- true
- xor
Example
string query = "/sitecore/content/#this or that#/*[@#site-title#=\"Example Value\"];
More information about the Sitecore Query Syntax on SDN:
http://sdn.sitecore.net/Reference/Using%20Sitecore%20Query.aspx
How to: Measure Outgoing Links with DMS
I received a question if it was possible to measure outgoing links with Sitecore in combination with the Digital Maketing Systen (DMS). By default this is not implemented within Sitecore or DMS. But Sitecore and the DMS are very easy to extend. I decided to create a Proof Of Concept to show the extensibility of Sitecore and the DMS.
For this POC I want to measure all the outgoing link using the Analytics Database of Sitecore Digital Marketing System (DMS). Based on this data I want to create a report in the Sitecore Engagement Analytics that will show all outgoing clicks by page. I want to create a solution that rewrites all external links within rich-text fields and General Link fields. With this solution all external links on an existing website will be automatically rewritten and measured.
In this article I will create a solution for measuring outgoing links in the following steps:
- Create a processor to rewrite all external links on the website.
- Save the outgoing clicks to the DMS Analytics database
- Create the Report to show the outgoing clicks.
Let get started!
Create the processor for rewriting external links
For the rewriting of the external links we are creating a Render Field Processor. This processor will fire for every field that is rendered. During this process we will rewrite the URL.
The easiest way to create a new processor is with … Continue Reading
Converting .mrt reports from OMS to DMS
In this article I’m going to explain how to convert .mrt reports from the Sitecore Online Marketing Suite (Sitecore 6.4) to the Sitecore Digital Marketing System (Sitecore 6.5).
Report related changes between OMS and DMS
Both the OMS and the DMS use .mrt reports for Analitics reporting. There are two mayor changes between the OMS and DMS reporting; a full redesign of the datamodel and the location of the SQL query for the report data.
Mapping the datamodel of the OMS with the DMS
If you compare the datamodel of the OMS to the DMS datamodel you will see that it’s completely different. But the main concept of both datamodels is almost the same.
| OMS table | DMS Table | Description |
| GlobalSession | Vistors | Contains the Visitor information. |
| Session | Visits | Contains the information of all the visits. A visits is underneed a Visitors. |
| Page | Pages | Contains all pages that are visited and are connected to a Session. |
The following drawing will show the relation of Visitor->Sessions->Pages.
In this example we have a … Continue Reading
Sitecore ECM: How to create a e-mail template from Scratch – Part II
In this post I will extend the basic e-mail template for Sitecore ECM with a title and text listing. With this e-mail template the business user can create new Title and Text items within the page-editor (Sitecore 6.4 and higher) or the content-editor (all versions of Sitecore). This article is a follow-up article of the Sitecore ECM: How to create a Email template from Scratch – Part I.
Create the Newsletter Text template
Create a template Newsletter Text with the following fields: Message Title and Message Text.
Add standard values for the Message Title and Message Text fields.
Add Newsletter Text folder to the Branche Template
Go to the Basic Newletter branche template and create a folder Newsletter Text. Assign the Newsletter Text template as Insert option.
Create Newsletter Text rendering
Create a new layout called Newsletter Text and copy the following code.
<div class="subitem-overview" style="min-height:20px"> <xsl:for -each select="./item"> <b><sc:text field="Message Title"/></b><br /> <sc:text field="Message Text"/> <hr /> </xsl:for> </div>
Update the Newsletter Text Rendering properties
Go to the content tab of the Newsletter Text rendering and add the Insert button to the Page editor Buttons field. … Continue Reading
Sitecore ECM: How to create a e-mail template from Scratch – Part I
In this post I will create a e-mail template for ECM from scratch. This article is based on a Webinar (in Dutch) I did about the Email Campaign Manager (ECM) you can see the Webinar on YouTube.
We build a custom template the same way that we build a page. First we will create the templates, than we will create the presentation components and at the end we will bind the presentation components to the template standard values. Let’s start building!
Create Basic Newsletter template
1. Open the template manager and create a new template called Basic Newsletter, Select the following base templates
/sitecore/templates/Modules/Email Campaign/Messages/Inner Content/Message Root
2. Specify the following fields :
a. Title
b. Text, set the source property to /sitecore/system/Settings/Html Editor Profiles/ Message Content
c. Header Text
d. Header Link Text
e. Footer Text
The Basic Newsletter template in will look like this:
3. Set the following standard values:
| Field | Standard value |
| Title | Newsletter title |
| Text | Newsletter Text |
| Header Text | Are you having trouble viewing the e-mail? |
| Header Link | Text Please click here to see the online version. |
| Footer Tekst | <table width=”100%” style=”font-family: arial,helvetica,sans-serif; font-size: 11px;” border=”0″ cellspacing=”0″ cellpadding=”0″> <tbody> <tr valign=”top”> <td> <div><b>Organization Name</b></div> <div>Street</div> <div>City</div> <div>Country</div> </td> <td align=”right”> <div>This message was intended for: “$email$”</div> <div><a href=”/link to unsubscribe page.aspx” style=”color: #c73318; text-decoration: underline;”>Unsubscribe</a></div> </td> </tr> </tbody> </table> |
Create Basic Newsletter Branche template
1. Create a branch template
2. Select the /sitecore/templates/Modules/Email Campaign/Messages/Pre-existing page template
3. Rename the create Pre-exiting Page branche template to Basic NewsLetter
4. Underneath the $name item create the Email Message root item based on the Basic newsletter template
5. Underneath the created Email Message root item insert a folder called Message Subjects. This folder will contain all subjects for the e-mail.
6. Remove the folder template to insert options of the Message Subject folder and add the Subject template: /sitecore/templates/Modules/Email Campaign/Messages/Inner Content/Newsletter/Subject.
7. Insert a Subject item in the Message Subject folder with the name Subject 1.
The branche template should look like this: … Continue Reading


Recent Comments