Sitecore: Creating Fieldtype External link only

During an Sitecore .Net development training I was ask if there is a fieldtype for an external link. The answer (of course) is; “Yes, general link”. With general link you can create a external link and many other types of links.  But what if you want to create a field in which the business users can only add an external link? You can easily create this with Sitecore (without any coding).

 

Create the External Link only Fieldtype

Fieldtypes are defined in the Core database. Switch to the core database and open the content editor and duplicate the /sitecore/system/Field types/Link Types/General Link item and call the item External Link.

Remove the unused link options

Underneath the newly created External Link item there is a folder called menu. Remove all items in the Menu folder except External Link, Clear and Follow.

 

Test the External Link Fieldtype

Switch back to the Master database and add a External Link field the to a template. Open an Item based on the template and you will see the newly created External Link field.

 


That’s it, we have created a new Fieldtype that only accepts External links.

Sitecore Webinar: Using Sitecore Rocks

Last month I gave a (Dutch) webinar about developing for Sitecore with the Visual Studio 2010 plugin Sitecore Rocks. You can watch the webinar on Youtube.

[youtube]http://www.youtube.com/watch?v=1nQ5dlAG-kg[/youtube]

In this webinar I builded a website from scratch in 30 minutes only using Sitecore Rocks

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

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.

image

In this example we have a Continue reading “Converting .mrt reports from OMS to DMS”

Sitecore ECM: How to extend personalization

Check the default subscriber profile by clicking the E-Mail Campaign node and go to the content folder. In the Implementation Details section check the selected profile in the Default Subsciber Profile field. By default this will be Profiles/Subscriber:

clip_image002

You can find the different profiles in the Profiles folder located at /sitecore/system/Settings/Security/Profiles/Subscriber in the Core database.

The Subscriber profile item is based on the Subscriber template. Open the /sitecore/templates/Modules/EmailCampaign/Subscriber template in the Template Manager and add a custom field called Hobby.

clip_image004

The hobby field will be added to the profile of the EmailCampaign Subscribers. Go to the User Manager, select a subscriber and click Edit. On the profile tab the hobby field will appear, insert a value into the hobby field.

clip_image005

Now let’s use the Hobby value to personalize the e-mail message.

There are two ways how you can use these fields within the e-mails. You can type $Hobby$ in a text field or within a richtext area you can select the field in the Insert Field dropdownlist.

clip_image007

To have the Insert Field options you need to add the Html Drop Down item to the toolbar of your Rich text profile or you can use the default Message profile by adding /sitecore/system/Settings/Html Editor Profiles/ Message Content to the source field of the rich text field.

Create a new e-mail in the EmailCampaign manager. And add the hobby fields to the E-mail by typing $Hobby$ or selecting hobby from the Insert Field dropdown in the rich text editor.

clip_image009

Save the change and close the Editor. Now reload your E-mail in the Message Preview tab and the $hobby$ field will be personalized and show my Hobby surfing.

clip_image010

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.

image

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">

<b></b><br />

<hr />

</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 II”