Thursday, December 17, 2015

Sitecore walkthrough of Email Experience Manager templates

Templates for Sitecore's Email Experience Manager (EXM) are a different process than a standard page layout. However once implemented they have the standard placeholder which can then hold sublayouts/renderings which can then use your existing controls and data!

One note is that email HTML generally has some different requirements than a standard page to ensure it loads correctly in all mail clients (outlook for example). You will need to do some research, but generally all css classes should be inline (not external files) and you should use tables over div elements...

Friday, December 4, 2015

TDS error - maximum message size quota for incoming messages

While syncing media items for a project using Team Development for Sitecore in Visual Studio, I came across the following error:
Exception The maximum message size quota for incoming messages (16000000) has been exceeded. To increase the quota, use the MaxReceivedMessageSize property on the appropriate binding element.
 This error occurs when large content (file size) is being brought into the source control solution. The fix is to open the file located at: C:\Program Files (x86)\Hedgehog Development\Team Development for Sitecore\HedgehogDevelopment.SitecoreProject.VSIP.dll.config and then modify the maxBufferSize attribute.

This may also lead to the error:
Exception For TransferMode.Buffered, MaxReceivedMessageSize and MaxBufferSize must be the same value.
 So the maxReceivedMessageSize attribute also needs to be changed to match the value of the maxBufferSize attribute.

And finally when syncing the offending item (large file size), the following error will occur:
Exception The maximum array length quota (16000000) has been exceeded while reading XML data.


Which means that the maxArrayLength attribute also needs to match the other variables.

Wednesday, November 25, 2015

Sitecore set the default domain for the login page

By default, the Sitecore login page will automatically use the Sitecore domain. Which works well for accounts such as sitecore\admin as you only need to enter admin to login. However if you are integrated with active directory, you may want to default the domain to the active directory one.

Code first Entity Framework composite key which contains a foreign key

I came across the need for a composite key in a code first Entity Framework database for a raffles system. The first table was the raffle setup and would contain an auto generated numeric raffle id and the raffle ticket table would have a relation back to the raffle table (foreign key which was the raffle id).

Monday, November 23, 2015

Syncing uCommerce data between Sitecore environments using Visual Studio

Because uCommerce data is actually stored directly in the database, syncing that shop data (products and even orders) is not as simple as using a Sitecore package or Team Development for Sitecore. The best method is to sync the actual database tables, of which there a number of tools available both paid and free.

I have found success using SQL Server Data Tools in Visual Studio. A download is available online, however there may be licensing considerations based on which version of visual studio you are using.

Working with the uCommerce API in Sitecore

uCommerce is a very powerful e-commerce module available for both Sitecore and Umbraco. The API that comes out of the box is equally powerful and have methods which make it possible to import a full product catalog from the third party system. This post will provide example calls into the uCommerce API, which should be everything needed to import data for a full catalog. Many of the methods assume one product catalog (which is a static variable).

Wednesday, November 18, 2015

Granting access to uCommerce to users in Sitecore

In a default installation, only administrators will have access to uCommerce in Sitecore. There is some setup that will need to be completed to give relevant users access to use/administer the system. This will be achieved by using custom sitecore group(s), and as with any group you can be granular with the access rights (for example one group may only be able to edit products whilst another has full access to purchase orders etc.).

In this example, one group will have access to all features of uCommerce.

Tuesday, November 17, 2015

Schedule code to run using Agents in Sitecore

In Sitecore the concept of an agent is simply a scheduled task that is managed by Sitecore, which will call a given method on a class. By default Sitecore will already have several agents defined in the web.config file, one example is an agent scheduled every 4 hours to clean up the publishing queue.

A specific example where I have used agents, was to schedule a custom class which synced data into Sitecore from a third party system.

Tuesday, November 10, 2015

Sitecore custom properties on a user profile

In Sitecore, by default there are a number of fields which are set on a user profile. These include such details as: full name, email address, password, comment, etc. It can be a requirement with a specific Sitecore implementation to store a number of custom fields against each user profile, perhaps mailing address details for example.

Instead of using custom SQL databases or Sitecore items, you can actually create a Sitecore template and have that appear on the user profile (as custom properties). To achieve this, you will need to complete the following steps:

Monday, November 9, 2015

Login, logout and registering accounts in Sitecore

The security model in Sitecore is abstracted from the default .NET providers of membership, profiles and roles. This means that it's actually possible to achieve the same functionality (login for example) using the default .NET methods rather than one from the Sitecore API.

A user in Sitecore will always follow the domain\username format, and all references to a username, need to include the relevant domain. That user will come out of the box with a default profile which includes such information as full name or email address, however it is possible to extent the profile with custom properties (using Sitecore's template system).

Friday, November 6, 2015

Indexing a computed field with Sitecore and Lucene

Out of the box it can be easy to configure simple Sitecore Lucene Search Indexes, that is using the standard data types for the fields you want indexed. However when it comes to more complex and even custom types you may need to setup a computed field to be indexed.

Take for example an image field, perhaps each page on your Sitecore web site has a primary image/thumbnail that you would like to expose in the results of your search engine. You could get the full item for each search result to get access to this field. However to save that call and have better performance it is possible to index the image url (and even a version of it with maximum width/height using Sitecore's media library). It is also worth noting that each field added to an index will cause that index to grow (which leads to more serve resources to generate, update and store the index itself). 

Wednesday, November 4, 2015

Sitecore package manager error

The following Sitecore error was occurring in the package designer and package installation wizard:
Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.
This was due to a missing DLL: Mvp.Xml.dll

Monday, November 2, 2015

Configuring Sitecore Lucene Search Indexes

Introduction

Search indexes are maintained by Sitecore scanning items stored in the database. Whenever an item is created, updated or deleted, a job is run in Sitecore which updates the search index(s). In the example of item creation, the item would be added to the index immediately after it is created.

The search index is a physical file (effectively a searchable database) which is maintained by the crawler and allows for searching of itself - which links to the actual Sitecore items. These index(s) are stored in the data folder for Sitecore, and can actually be viewed (and even queried) via a third party tool such as Luke 3.5.

Wednesday, October 28, 2015

Sitecore custom field validation rules

Out of the box there are a number of field validation rules which can be applied to template fields (for both item templates and rendering/sublayout parameters templates).

Sunday, October 4, 2015

Are you getting the most out of Sitecore?

Sitecore is a leader when it comes to web content management systems (for 6 years now they have appeared in the leadership quadrant in the Gartner Magic Quadrant for Web Content Management). In the growing (yet crowded) market that is web content management, to hold this position is a testament to Sitecore as a CMS and what it has to offer.

For existing Sitecore implementations, it can then be useful to explore the question Are you getting the most out of Sitecore? Perhaps the web site began with an initial like for like migration from another CMS, or a first stage where the goal was to get the site live (with marketing features added later). Whatever the reason, due to the sheer number of features available in Sitecore (which are ever expanding and improving), there is also the possibility that your website is not getting the most out of Sitecore. This post is going to look at some features available in Sitecore that can be used to meet your organisations goals, whether that be; higher sales volume, more leads, more engaged users, a better user experience and so on.

Friday, October 2, 2015

Creating RSS feeds of your Sitecore content

Sitecore allows you to create an RSS feed for any content item that you have on your web site. Common sections that are good candidates for RSS feeds are news/update items or blog posts, however creating feeds for other items is a simple way to expose the data to third party systems (company portal for example).

For example, if you had news content (that was based on a custom news template) you could create an RSS feed of the content using the following instructions:
  1. Create a folder in your content tree called "Feeds"
  2. On the feeds folder click "Insert from template" and select "RSS Feed" (available under /sitecore/templates/System/Feeds/)
    1. Under Items, select the parent item (where all of your news items are descendants)
    2. Under the Description field, enter a description of the RSS feed
  3. Under templates navigate to the template of your news item (the template which the descendants of the item selected above are of). Select the standard values and from the top ribbon select Presentation and then Design (feeds).
    1. From here you map a title, body and date field from the item template and save and close.
  4. Publish the web site, and navigate to the location of the RSS feed from step 2. You will now see an RSS feed. Please note that this will format correctly in Firefox and Internet Explorer, but will appear as XML in Chrome.

* If you have multiple templates under the item selected for the RSS feed, you will need to set presentation details for each template type. If you don't the item will not appear in the feed, this is also a good way of keeping any containers organizing the content (categories for example) from being displayed in the feed.

Wednesday, September 23, 2015

Sitecore get media item from ID

When dealing with fields which are of the ImageField type is is trivial to get the media item (image) that is referenced in that field. However when using a Treelist field, which allows users to select images, you are given a delimited string of item IDs of the selected image(s).

To get the MediaItem, simply get it as a normal item (to ensure it exists and is actually a media item) and then parse it as media item.

Monday, September 21, 2015

Sitecore Web Forms for Marketers Overview and how-to guide

Most web sites on the internet will have some sort of form available for users; from a simple form that accepts an email address to subscribe to a newsletter all the way through to a large data entry form with complex business rules and logic. Setting up the web form and making any modifications will often require developers time and code deployments, something which is not ideal in the fast-paced and often responsive world of marketing. Sitecore has an innovative approach to online forms with it's free Web Forms for Marketers module.

The module empowers content editors to create their own web forms, choose a form action (such as emailing the data to an address), then display the form on the desired page(s), ready for users to complete. The form creation process follows a simple user interface that requires minimal training, adding the form to a page is the same process that content authors will be familiar with, and the number of form save actions should meet most business requirements with no custom development time.

The form creation interface

Once you create a form in the content tree, you have the option to open the form designer. This is the area where the form elements are created and general settings such as: title, introduction and footer are set. There is also the option to export the form to ascx (which developers can use to bring the form into custom code without having to redo the form manually). 

Web Forms for Marketers ribbon

There are many different field types which can be added to the form, such as simple text, or more complex types like email or phone number which have pre-defined validation. The list types such as Drop List or List Box allow a data source off of the content tree, which allows for selections from existing content (this could be custom categories for example, or even business departments).

Web Forms for Marketers field types

Validation can also be manually applied to any field on the web form, the default validation types include: numbers only. letters only, special characters must be included, number and special character and email address. With custom validation you have the option to use a regular expression (which allows you to validate on a custom pattern), an example of this would be a member number or ID which would have format and length governed by business logic.

Web Forms for Marketers form designer example
In the form designer example above, I have created a simple contact form. It accepts a first/last name, email address and user comments. Key fields are set to be required and the email address is set to the email form (which includes validation by default).

The form Save Actions

Once the interface of the form is designed, the save actions need to be set so that the data entered into the form actually goes somewhere. The following save actions are currently available out of the box in Web Forms for Marketers:
  • Add the contact to a contact list
  • Change Password
  • Enroll in Engagement Plan
  • Update Contact Details
  • Create Item
  • Create User
  • Edit Role Membership
  • Logout
  • User Login
  • User Login with Password
  • Send Email Campaign Message
  • Send Email Message
  • Send MMS
  • Send SMS
  • Tell a Friend
  • Register a Conversion
  • Register a Campaign
It is also possible to select any number of these save actions into the same form. One example of this may be registering a user and then enrolling them into an engagement plan. 

Web Forms for Marketers save actions

Each save action can also have a custom error message displayed on fail, this is good because it allows for granular error messages for key and non-key save actions. 

Web Forms for Marketers save actions error messages

For the contact form example above (in the form designer section), I am simply going to set the save action to Send Email Message. Once the save action has been added, the edit button needs to be clicked to configure that action. 

Web Forms for Marketers save actions configuration

The configuration for each save action is different, in the send email example we simply set the email options and the message itself. The field values are entered into the message using the insert field option and appear [Like So].

There is also a global configuration that needs to be setup for some of the save actions. Sending an email message for example requires email server details (SMTP) to actually send the mail. In this case, the configuration is set at: /sitecore/system/Modules/Web Forms for Marketers/Settings/Actions/Save Actions/Send Email Message. The important field to set here is Parameters - which should contain valid mail server details.


Adding the form to a page

Once a form is created, it can be added to a page (and even multiple pages) by using the Form (or MVC Form) rendering. These renderings are added to Sitecore when Web Forms for Marketers is installed and are available at: /sitecore/layout/Renderings/Modules/Web Forms for Marketers.

As content editors will be familiar with, the rendering can be added to any of the allowed placeholders via the content editor or page editor.


In the control properties window of the Form rendering, simply select the form created earlier. Once a publish is complete, the form should appear on the nominated page.


Conclusion

Web Forms for Marketers is a powerful module, that enables end-users to have complete control over forms used on a Sitecore site. It takes away the need for developer time and deployment, and allows content editors and marketers to respond to their needs right away, in a secure manner. 

As the how-to guide above shows, it's a simple process that will make sense and be easy to follow for users already familiar with Sitecore's content editing interface. It already comes ready with many save actions on the forms (for both simple and more advanced tasks), however like anything Sitecore, it's always possible to extend Web Forms for Marketers to meet any complex business needs.

Tuesday, September 15, 2015

The benefits of Sitecore's Email Experience Manager

In the past content management systems have lacked the ability to handle enterprise level email campaigns natively, and this has led to many marketing departments to utilise third party tools such as MailChimp or Campaign Monitor. For those organisations currently using Sitecore or considering using Sitecore, the email experience manager is the answer and I will detail the benefits of it over the competition.
  1. Cost: email experience manager is a free module offered by Sitecore. There are no monthly yearly fees applicable for using the module. There is a paid option/addon to send the email via Sitecore's servers, however you are able to use your own or a third party service. Sitecore offers the message transfer agent (MTA) service as a value add due to the risks with blacklisting of internal email servers due to perceived spam.

  2. Availability/Management: email experience manager is installed on your infrastructure (whether that be in the cloud or on physical servers) and completely under your control and not at the mercy of a third party located overseas (with limited support). This means all updates, downtime and security is managed by you, and any support is available via the helpful Sitecore support team and any Sitecore partners you may on the journey with.

  3.  Shared Content Items and Media: With third party email campaign systems, content is generally prepared in word documents and approved manually by emailing the document around. This is a risk because the content may change (both visually and textually) when entered into the third party system. With Sitecore, when preparing an email you have access to any content items and media library items available from your main web site. The real risk minimisation here, is that it's the same content items that passed the required workflows and were entered, approved and managed by the relevant stakeholders. This allows for easy collaboration between departments and saves a lot of time and headaches.

  4. Code Customisation/Extension: Third party systems are able to provide a service which meets the broad markets requirements, with no room for customisation or extension. When a unique business requirement, unique campaign or interactive campaign comes up, these systems are often not able to meet the brief. As with Sitecore as a whole a series of pipelines are exposed which give developers access to customise/extend how different parts of the CMS work. These pipelines really open up the email experience manager to unique customisation, for example the following is just a sample of what could be achieved with just one of the many extension pipelines:
    • Use the CheckPreconditions pipeline to require approval from a department/business manager before sending to a given recipient or recipient list.

  5. Use of Sitecore interface: The Sitecore interface for building a page and content up is simple, elegant and not time consuming at all. The interface is nothing but familiar across releases, and is not likely to change overnight like some third party tools. Email Experience Manager using the exact same interface as Sitecore CMS, means less training is required for end users, and if any help is required from the developers, they actually know the system well themselves. Remember this interface also gives direct access to the same web content and media as available on the web site.

  6. Personalisation: Personalisation is becoming bigger and better each year and many organisations are starting to realise the true power it offers in terms of providing the right information at the right time to the right user. Harness all of the information you already know about your Sitecore web site visitors and personalise emails just for them. Send email directly based on a user's browsing history, interests, past purchases and so on. Then take it a step forward and begin to anticipate their needs and email based on that. 

  7. Trigger Emails: With email experience manager, emails are not just sent manually whenever a newsletter is created and recipients added. You also have the ability to trigger emails and target your web site's users by the use of custom engagement plans. If a user registers to your web site, send them a welcome email. If a user starts going through a checkout process, but drops out before paying - send them a discount coupon to complete the sale. The opportunities with triggered email messages are endless and they lead to more goal conversions and a higher visitor engagement value. These emails are also not hard coded and maintained by developers, they are emails available for edit by content authors - as is the content/images they use.

  8. Send Emails from Custom Code: Many web sites have custom code with complex business logic that may require emails being sent. It is possible to send a message using code (to single and multiple recipients), as the logic requires. The benefit here, is that like triggered email (single recipient) the email messages are not locked away in the code but made available to content authors.

  9. The Sitecore Connected Experience: Sitecore offers a completely connected experience across all channels which no other system is available to offer. Email Experience Manager integrates right into the other Sitecore® Experience Platform™ offerings, which include; web site, commerce, mobile, social and even print. This allows for the complete customer journey h a unified front with consistent message and branding that ultimately leads to more informed and interested users.
Source: Sitecore

Sitecore parameters on the TreeList template field

The TreeList field in Sitecore is a great way of exposing items in the Sitecore content tree for selection. Not only does it take in a source field (which points to a parent item in the Sitecore content tree), but the source also accepts parameters which control the TreeList itself.


These parameters are built up as querystrings are: param1=X&param2=Y

  • DataSource: A path to where the data source is located
    • datasouce=/Path/To/Items
  • AllowMultipleSelection: Allow the same item to be selected on the TreeList (more than once), this is false (no) by default.
    • allowmultipleselection=yes
  • ExcludeTemplatesForSelection: A comma separated list of template names which are visible in the tree and not able to be selected.
    • excludetemplatesforselection=Template Name,Other Template Name
  • IncludeTemplatesForSelection: A comma separated list of template names which are visible in the tree and able to be selected.
    • includetemplatesforselection=Template Name,Other Template Name
  • ExcludeItemsForDisplay: A comma separated list of item names or IDs which are excluded from display in the content tree.
    • excludeitemsfordisplay=Item Name,Other Item Name
  • IncludeItemsForDisplay: A comma separated list of item names or IDs which are included in the tree.
    • includeitemsfordisplay=Item Name,Other Item Name
  • ExcludeTemplatesForDisplay: A comma separated list of template names which are excluded from the tree.
    • excludetemplatesfordisplay=Template Name,Other Template Name
  • IncludeTemplatesForDisplay: A comma separated list of template names which are included in the tree.
    • includetemplatesfordisplay=Template Name,Other Template Name
  • DatabaseName: Sets the name of the database being referenced.
    • databasename=OtherDataBase

Wednesday, September 9, 2015

Sitecore trigger a goal on a media library item

Goals are not just assigned to pages or programatic events, you can also trigger them on viewing of a media library item. For example if you had a brochure PDF file in the media item, it would be possible to set a "Download Brochure" goal on that item.

To achieve this, log into Sitecore, open the media library and select the item you wish to assign the goal to. From the top menu select Analyze and then Goals


Now select any goal(s) which apply to the media item.


Friday, August 28, 2015

Tracking Google AdWords performance and value in Sitecore

Google AdWords are a great way of driving targeted visitors to your web site. However as there is a direct monetary cost on acquiring this traffic, you want to ensure you are getting the best value for money. Using the Experience Analytics and Marketing features in Sitecore are a great way of tracking the performance of various Google AdWords keyword campaigns.

Step 1: Sitecore Campaign

The first step is to create a Sitecore campaign for your AdWords campaign. Depending on the amount of parallel campaigns you are running on AdWords you could create one campaign per keyword or one per group of relevant keywords. To create a campaign in Sitecore:
  1. Login to Sitecore
  2. Open the Marketing Control Panel
  3. On the content tree select Campaigns and then right click Insert > Campaign
  4. Give the campaign a relevant name, in this example "Test Campaign"
    1. For the channel select Google ads (under: Channel/Online/Paid Search/)
    2. If you have a custom campaign group (such as Paid Advertising) you can select it
    3. Take note of the campaign link (something like: sc_camp=686A5C84924C40A188204A4999A03119)
    4. Save the campaign
  5. On the main ribbon, select Edit and then Deploy to make the campaign active
  6. Now in Google AdWords set the relevant campaign(s) links to include the campaign link as query string. For example: http://mysite.com/LandingPage.aspx?sc_camp=686A5C84924C40A188204A4999A03119
  7. This campaign will now begin tracking in the Sitecore Experience Analytics database

Step 2: Measuring Results

There are a number of ways to measure the results of your Google AdWords campaigns in sitecore. There is no best method to measure the results for every web site, because different web sites will have different strategic goals. However any of the following Sitecore Experience Analytic features should give an indication as to the performance.


  • Top campaign by visits - Shows which campaigns are receiving the most traffic. Of course this is relative to the number of impressions the ad receives in Google search results.
  • Top campaigns by value per visit - This is generally a good measure, because it shows which campaigns are leading to the most Engagement Value per visit. Assuming the Engagement Values have been optimized and planned carefully, this will directly show which Google AdWords are the "best performing".
  • Top campaigns by bounces - A high bounce rate can identify content/landing pages which are not relevant to the keywords coming in and which may be due for optimization.
  • Data Table: This is where the real data becomes apparent for all of your campaigns:
    • Conversion rate shows the average percentage of conversions to a web sites goal(s). Ideally you place goals on activities which relate to/are your web site's strategic goal, so a higher conversion rate is idea.
    • Page views per visit show a general indication of how engaged the user is. A higher number of page views per visit can show a very interested user (and should correlate with a higher value visit), where as a low number of pages per visit may be a sign of less interested visitors (and a sign to look at content optimization or pulling the AdWords campaign).

The use of campaign groups is also a great way to compare the various sources (such as Google AdWords) versus other networks to see which leads to better performance and value. Depending on the type of web site and it's strategic goal(s), various advertising sources may perform better than others. For example, for a highly technical web site, advertising on the technical help site Stack Overflow may have better results than Facebook ads. Likewise you may also find that email campaign mail outs are having better results than Google AdWords and choose to focus more in that direction.

Step 3: Optimization

Now that you have some idea around the performance of your Google AdWords campaigns in Sitecore, there are some activities that can be undertaken to optimize them. These are just some general notes on how you can optimize and will not be complete step by step instructions.
  • Personalization - The rule set editor in Sitecore allows personalisation on a number of conditions including campaigns. By personalizing the web site based on a campaign (in turn the Google AdWord) you are able to optimize the experience for that particular targeted keyword. This allows content to be setup in a way to drive users into completing strategic goal(s) and even other goals targeted to a particular set of keywords. For example if the web site is an online store and the AdWord is in relation to a particular product line, the content could be personalized with emphasis put on this product line - ultimately leading to more sales (the main strategic goal) and therefore higher Engagement Value.
  • A/B + Multivariate Testing - A/B multivariate testing can be used on landing pages for Google AdWords campaigns to test what various elements lead to better results (any of the measures above). Sitecore is ideal for this type of testing, whether it be as simple as testing the words of a call to action, right down to multivariate of content, style and layout.

Sitecore Engagement Value a measure of success

In the past simple measures such as the number of hits, sales/leads generated, and simply traffic sources would be used as analytical data to judge the success of a web site. Sitecore is the market leading CMS and is packed full of analytical data inside it's Experience Analytics and Experience Profiles. Furthermore the marketing capabilities allow content authors and marketers to optimize the entire experience for users (across all channels - including web, mobile, social and even print). One interesting feature available out of the box in the Sitecore arsenal is: Engagement Value.

Strategic Objectives

A web site should have a strategic objective which it is trying to achieve with every user. For example an online store may have a strategic objective to make a sale, whereas a service based web site may have a strategic objective to generate a qualified lead. This strategic object is then what drives and determines the engagement values across the web site.

For the strategic objective of generating a qualified lead, a goal around completing a callback form would be given a high value (100 points for example) as this shows the user is highly interested in that service, where as a goal around downloading a brochure file would have less of a value because while it shows engagement and interest, it's not the highest valued goal.

If you set high values on less than ideal goals (such as simply downloading a brochure, versus completing the callback form) you are then likely to begin optimizing the site for downloading the brochure rather then completing the callback form. Each goal or action that aids in meeting the strategic objective is worth some engagement value, it then becomes a balancing act to apply the correcting value to each so that you optimize for the correct goals, and also not missing any items out which can aid in meeting the strategic objective.

An example of some engagement values for a service based organisation with a strategic objective of generating a qualified lead could look like:

Value Goal
100 Complete the callback form
60 Signup for a demonstration
30 Get an online quote
10 Signup for a mailing list
5 Download a case study brochure

Assigning Engagement Value

When you create a goal in Sitecore, there is a field (defaults to 0) which allows you to specify the points for that goal. It's these points which are the Engagement Values.

Viewing the results of Engagement Value - The measure of success

Throughout the Experience Analytics section in Sitecore, the average values are shown in the data tables.

The example above shows the top exit pages for the web site, it it the value is visible. By looking at the top exit pages, and the corresponding value, you are able to see where low value visitors are exiting the site and can make optimizations based on that.


In the example above, the value is shown for the marketing campaigns. In this case the email campaign had better results than Facebook (based on both value and time spent on site). These campaigns would have a monitory cost, so figuring out which ones provide the best value for money is important.

These are just a couple examples of the usefulness of engagement value in Sitecore. When it comes to search keywords (paid and unpaid), A/B + Multivariate testing and even personalisation you can use engagement value as a measure of their success.

The real benefit here is that you are not only optimizing on a single goal (such as a sale or callback form submission), but a whole set of goals that all contribute to the strategic objective of the web site. Sure, the main goal (which is likely making the sale) will be worth the most engagement value, however the other goals are still valuable (albeit not so much). With Sitecore Engagement Value you optimize for the full picture and all items that contribute to the strategic goal, ultimately this will lead to more success.

Wednesday, August 26, 2015

Redirecting HTTP to HTTPS on IIS

It can be beneficial for security and SEO reasons to secure an entire web site, rather than pages were there are login forms and other private data. The myths around performance hits have been debunked, and the main potential downside is around third party ad networks (and many sites don't display ads like this anyway).

To achieve redirection from non secure to secure URLs on an IIS web site, the URL Rewrite Module will need to be installed on the server. Then the following XML will need to be added into the web.config (site root) inside the system.webserver section.

Now URLs such as http://example.com/page.aspx will redirect to https://example.com/page.aspx.


Do you prefer site-wide SSL or simpl on select areas/pages? Discuss in the comments below.

Tuesday, August 11, 2015

Sitecore triggering a goal programatically

Goals are simple to setup to be trigger on Sitecore items, however there are times where goals may need to be triggered in the code. This is generally the case where the goal is triggered based on some business logic, and in these cases the following code can be used. Please note: This code is for version 8 onward, there are some older methods which are no longer used.

The code above accesses the goal item in Sitecore via GUID (don't forget to publish!) and then registers it to the current page - also using the goals description as extra information.

On the goal item in Sitecore, you are also able to set if the goal is shown in events/latest events in the Experience Profile (a custom image can also be defined here).


This then means that the goal will show inside of the Experience Profile, which is great for a complete overview on site users.


Sitecore using custom SMTP for the Email Experience Manager

For the sending of email from the Email Experience Manager in Sitecore, the default option is to use the Sitecore Message Transfer Agent (MTA), which is a paid service available in the App Center. However it is possible to purchase the right to use a custom MTA, aka the UseLocalMTA setting. Development/Testing licenses are likely to already have this option enabled, it is the prod licenses that are likely to require a payment.

It is worth noting, that it's not recommended to use the SMTP details of the clients main domain (where there business email comes from), as there may be consequences in terms of spam and trust levels of the server. Therefore the Sitecore MTA or another custom email provider is recommended for the Email Experience Manager.

Using a custom SMTP server

  1. Open the Sitecore.EmailExperience.ContentManagement.config file which can be found in Website\App_Config\Include\EmailExperience
  2. Set the UseLocalMTA setting to true
  3. Set the SMTP settings to that of the SMTP server
    1. SMTP.Server - server URL or IP
    2. SMTP.Port - port (usually 25)
    3. SMTP.LoginDomain - login domain may be required if on internal network
    4. SMTP.UserName - username
    5. SMTP.Password - password
    6. SMTP.AuthMethod - authentication method (default of NONE should work)
There are also proxy settings available, if the server is on a network where proxies are required for security reasons.

As of Email Experience Manager 3.1

Monday, August 10, 2015

Installing the Sitecore Email Experience Manager

Introduction

The Sitecore Email Experience Manager (or EXM) is a free module provided for Sitecore, which can be harnessed not only for simple emails, but marketing activities. With the advanced marketing capabilities available today, it's no longer best practice to blast a stale and static email to every user, hoping for high conversions and low subscriptions. Sitecore EXM brings a number of key features to the table. which include:
  • Team collaboration - Creating the emails themselves and even the landing pages is a collaborative effort with everyone working together using the same workflows and assets to deliver a consistent end product.
  • Automated emails - Sitecore allows emails to be triggered on events, behaviors and any of the other customer experience data. You may use this to send a welcome email upon registration, a confirmation email upon submitting a form/request or perhaps even a happy birthday message on the users birthday.
  • A/B + multivariate testing - Test whether or not factors such as subject, formatting, media and even timing to see what variables deliver the highest conversion rates.
  • Personalization - Sitecore is collecting data on each user which can then be used to send relevant emails to your users. By sending the right information the users will appreciate the email more and are less likely in unsubscribe and more likely to follow through with a call to action.

Installing Sitecore Email Experience Manager

The first step is to download the correct EXM package from your Sitecore version from the Sitecore Developer Portal. This is not be be confused with the Sitecore Campaign Manager (for pre-version 8) available on the Sitecore SDN. Also please note that this download itself is not the sitecore package.
  1. Extract the download and find the package.zip file - this is the Sitecore package
  2. Login to your Sitecore instance's administration desktop. Then click Control Panel > Administration > Install a package
  3. Upload the package and then click Next and Upload
  4. After the upload is complete click Next to start the installation
  5. Read and accept the license agreement, the click Next
  6. Make a copy of the installation notes and click Next
  7. The package details will now show, you can click Install
  8. Once complete, you should restart the Sitecore client
If you use multiple server for content delivery, analytics, and email processing for example, there are some deployments that will need to be made to those servers. These files are included in the file downloaded from the Sitecore dev portal (they are not packages that need to be installed).

Once installed the following steps from the installation notes need to be followed:

  1. Attach the Sitecore.Exm database. The file can be located in the Data folder.
  2. Add the connection string "exm.dispatch" (the SQL Server connection string) to /App_Config/ConnectionStrings.config
  3. Run Sitecore.EmailExperienceManager.sql for the reporting database (Analytics) of your instance. The file is available at Data folder.
  4. Publish your site using smart publish. 
  5. In the App Center, configure the Email Delivery service. - This is the paid MTA service
The Sitecore Email Experience Manager is now installed and ready to use. On the first load you will be promoted to enter some default settings:


Simply enter the site's URL along with some general email settings and you are ready to go.

Wednesday, August 5, 2015

Sitecore media library database storage compared with file system storage

The Sitecore media library is one of the great features available out of the box with Sitecore. Not only does it allow you to keep all media files (images, documents, video/audio etc.) in one place, but they can also be versioned and kept in a clean folder structure similar to Sitecore content items. You are also able to search through the items, which other content management systems may not offer.

By default, the storage mechanism for the Sitecore media library is database - that is the files are all stored in SQL Sever as blobs. However this is a configurable setting and the storage mechanism can be set to file system. Like anything in the development/infrastructure world, there is an argument about which method is best - database or file system. Ultimately the answer depends on that particular implementation and it's requirements; so here are the facts that can be used to make a decision.

Sitecore Media Library - Database Storage

The main benefit here is that there are no physical files to work with. If you have a more complex Sitecore server architecture (with multiple content deliver server for example), then there is the issue of syncing the physical files across servers. Database storage removed the dependency on physical files, so all content delivery servers have the same data source, also it allows syncing of the media across environments (dev, test, production) easy via the use of the package manager or hedgehog TDS.

The main downside here is that as your media library grows the database grows, which can have affects on the resources needed to both run the database server and back it up. Also because it takes .NET code to retrieve and render these images via the ashx handler, the Sitecore servers will also require more resources to work with media stored in the database. 

In terms of file size limitations, you can store large media files (such as video) in the media library. However when you start getting into high traffic, or large numbers of these files, other solutions might be better suited. A video going viral for example, could bring down not only the database, but the Sitecore content delivery servers themselves.

Sitecore Media Library - File System Storage

File system storage can be beneficial in certain situations, especially when a third party content delivery network is involved. A CDN will require actual files so this would not work when using database storage, however there may be development effort required to actually get the CDN working with the images and to have them render from the correct location.

With the files not being stored in the database, the DBMS will require less resources (as it's not storing and processing large amounts of media). Backups of the databases are not as troublesome, and require less storage space. Also there is less potential for data blocking and other issues that may occur in a busy or under-resourced database.

Conclusion

As with any development or architectural consideration, there is never a one size fits all approach that will work every time. In terms of which storage method to use with the Sitecore media library the business requirements need to be analysed to work out which method will work best with a given implementation. This is also an area where future proofing needs to be considered, there may not be many media items now, but if video files will be required down the track; then this will definitely influence a decision. 

Tuesday, August 4, 2015

IIS restrict access to a web site

For development and test servers which may need some external access, it can be good practice to set up security around which IPs can access the web sites and which will be denied. The first requirement is to install the required server role:

  1. Open the server manager
  2. Click Manage and then Add Roles and Features
  3. Select the installation type and click Next, then select the server and click Next
  4. Under server roles expand Web Server (IIS) > Web Server > Security and then check IP and Domain Restrictions
Now under IIS manager, the IP and Domain Restrictions item will be available at the web site level. 

To block all IP addresses by default: Edit Feature Settings and set Access for unspecified clients to Deny. Allow entries can then be added for any IPs which you wish to have access to the web site. 

The reverse can also be done, with Access for unspecified clients set to Allow and any IP addresses you wish blocked added as Deny Entries.

Internet Explorer and Initial Keyword CSS

I came across an issue with CSS and the initial keyword. In CSS initial is used to effectively inherit the properties from the parent. However this keyword is not supported in any versions of internet explorer which can lead to elements rendering incorrectly. The fix is to add the property inherit first, and then initial on the next line. This will allow the element to render correctly in IE and as normal in other browsers.
left: inherit !important; /* IE */
left: initial; /* Other Browsers*/

Friday, July 31, 2015

Sitecore Experience Profile - Logging Searches aka Internal Keywords

As discussed in my overview on the Sitecore Experience Profile, it is a powerful tool which provides in depth analytics and tracking of users of your Sitecore web site (both anonymous and identified). One interesting feature of the experience profile is the search terms or Internal Keywords. This allows any searches a user makes internally (by any custom searches) appear inside the experience profile.


To register search terms in the experience profile some code will need to be added into your custom search logic.

Wednesday, July 29, 2015

Sitecore Experience Profiles How to Identify Users

In my Sitecore Experience Profiles and Identifying Users Overview post I covered the basics of Experience profiles, along with why it's beneficial to have identify users over anonymous users. In this post I will provide the code needed to actually identify the users - this will claim all of their data and assign it to one named profile.

Creating the user

The initial step is to "create" a user and populate some of the base data we know about them. This may be general information (Name and Title), contact details (especially email address) and even a picture. You would generally perform this action when a user is first defined: such as on registration onto your web site, or on submit of a contact form.


The code above is ensuring there is a current Sitecore analytic tracker and then assigning the details of the user to is. Once this action is complete the user is identified and all of their past/future data (based on cookie/session) is assigned to them.

Identifying a user

If the user visits again in the future, perhaps on a different device, their session will no longer be associated to them. This means that all data will once again be assigned to another anonymous profile, which is no good when you are trying to build the complete picture on a user (their browsing habits, goals reached, campaigns partaken in and so on). Therefore the following code could be run when a user identifies themselves (such as on login).

Once this has run, if a match is found, the users data is stored against their experience profile, and the customer insight continues.

Sitecore Experience Profiles and Identifying Users Overview

Sitecore customer experience profiles provide a high level overview of the customer and provide insight into their experiences across all channels which ultimately builds up into a full picture of that customer.

In Sitecore 8 the basic flow for the analytics collection is as follows:

  • The user access the web site (desktop browser).
  • As the users browses the web site (and completes actions) the data profile is building up inside the MongoDB session.
    • If the user is unknown the session is stored against an anonymous user, however if identified the data is stored against a known contact.
  • Once the session ends/expires the data is flushed into the Experience Database where it will be displayed via Experience profiles and Experience Analytics in the Sitecore administration area.

Known users

The ultimate goal here is to create known users which then allows interactions to be tracked across all channels (desktop, mobile, email etc.). A user is generally identified via their email address (which can be gathered from logging in, completing a form or subscribing to a newsletter). 

To create a contact record a call can then be made via code to the Sitecore API to store the visitor's details (it may just be an email address, but can be full contact information and even picture) - all of their data from anonymous browsing is also retained against their new contact record.

On future visits (where the session may have ended or the cookie deleted) you can also identify a user by email address (in code) to ensure all data is stored against their profile and not an anonymous one. 

What can we track?

I like to think of a customer's Experience Profile as a puzzle. There are many pieces of the puzzle which can be used to build up the picture, and like the puzzle you can often make out the whole picture without having all of the pieces. On that note, without going into every piece  available, here are some of the features of the Experience Profile (each contact card):
  • User details (including photo)
  • Visits (as well as each page visited and for how long)
  • Pattern/profile matches
  • Campaigns
  • Downloads
  • Searches

Conclusion

Sitecore is the market leading CMS when it comes to marketing automation and analytics. Just from this quick overview it is evident just how powerful having Experience Profiles of customers can be, especially considering it works on every channel and integrates with Sitecore's marketing activities. Another point to consider is bringing in external information into the profiles from external sources such as CRM.

My follow-up post (Sitecore Experience Profiles How to Identify Users) has the code required to create the users and identify them on subsequent visits.

Monday, July 27, 2015

Windows server 2012 moving the SMTP mailroot folders

By default, the SMTP mailroot folders (badmail, Drop, Pickup and Queue) will be stored on the C drive - C:\inetpub\mailroot to be precise. For the purpose of backups or some other reason, you may have moved inetpub to another drive (D drive for example). To have the local SMTP sever pickup the relocated mailroot folder you will need to follow these steps:
  • Install IIS 6 scripting tools
    • Launch the server manager
    • Click Add roles and features
    • Select Role-based or feature-based installation and select the the current server
    • Expand Web Server (IIS) > Management Tools > IIS 6 Managament Compatability and then check IIS 6 Scripting tools 
    • Click next > Add Features and complete the installation
    • There should now be an AdminScripts folder in the C:\inetpub directory, this will contain adsutil.vbs which is used to update the mailroot folders.
  • Stop the SMTP server (this is done from the IIS 6 Manager)
  • Open up the command prompt in administrator mode and run the following commands - changing the the new folder directories as required:
    • cscript.exe C:\inetpub\AdminScripts\adsutil.vbs set smtpsvc/1/badmaildirectory D:\inetpub\mailroot\Badmail
    • cscript.exe C:\inetpub\AdminScripts\adsutil.vbs set smtpsvc/1/dropdirectory D:\inetpub\mailroot\Drop
    • cscript.exe C:\inetpub\AdminScripts\adsutil.vbs set smtpsvc/1/pickupdirectory D:\inetpub\mailroot\Pickup
    • cscript.exe C:\inetpub\AdminScripts\adsutil.vbs set smtpsvc/1/queuedirectory D:\inetpub\mailroot\Queue
  • Start up the SMTP server again (this is done from the IIS 6 Manager)

Migrating from SharePoint to Sitecore

Introduction

For use as an external web site (as opposed to an internal intranet) SharePoint has progressed forward since the 2003/2007 versions and has many positive aspects. However, in more advanced areas such as marketing automation, e-commerce and custom data structures (everything is a list) it is lacking and may not be the best solution. Sitecore on the other hand is market leading in these areas (including marketing features), which leads to migrating from SharePoint to Sitecore.

The first step

As with any migration process, the first step you should follow is to identify what type of migration is going to take place. It is this that will affect the scope of the migration, the steps taken and ultimately the plan of action.Some examples of types of migrations are:
  • Like for like migration - in which case, very detailed requirements will need to be created to ensure nothing is missed.
  • New site (reusing majority of old content) - in this case you would create requirements of the new Sitecore site, see which elements (content, code or design) can be migrated from the old SharePoint site and to what level these elements can be migrated.
  • Migration of selected content - this may occur when a greenfields site is being created where some selected content (perhaps product information/history or other list data) is required but nothing else (page templates, widgets and unwanted content).

From the top down

The following list contains common SharePoint elements which are commonly included in an external web site, and what they could be potentially created as in your new Sitecore web site.

Master pages and page layouts - In SharePoint a master page contains the look and feel of the web site (base HTML/style) along with any shared components common across the site (navigation and footer for example). A page layout will contain field controls and web parts which are relevant only to pages using that layout. In Sitecore the master page(s) would be created as a layout(s) and the page layout content could be migrated to sublayouts/renderings which are added to placeholders (both on the layout and inside the sublayouts/renderings themselves). 

Pages - A page in SharePoint uses a page layout to display content - which may be web parts, lists/libraries or HTML blocks. In Sitecore you would simply create a page template (which would contain general fields such as metadata and title etc.). This page template would then contain the required sublayouts/renderings which contain the content of the page (a layout would be used in place of a master page as well).

Web Parts - In SharePoint a web part is essentially a user control which contains front-end and back-end code which performs a given task/action. This web part may also interact with the SharePoint data (lists for example). In Sitecore a sublayout/rendering has a similar concept to a web part, being that it is a user control with front-end/back-end code which can be re-used (multiple times in the same item/page as well). Code can also be re-used when migrating from a web part to sublayout/rendering - just remember that any SharePoint data sources will be replaced as well.

Lists (custom, calendar, announcements, etc.) - When it comes down to it, everything in SharePoint is stored as a list. Whether it be a custom list, or one of the out of the box types, they can be migrated to custom templates in Sitecore. The benefit of custom templates is that there are more data types to choose from, and you can inherit from other templates (so common elements across your SharePoint lists are defined in one template in Sitecore).

Document/Picture libraries (lists) -SharePoint is known for it's document management capabilities, however document/pictures are ultimately stored in a list (with versions). Documents and images can be migrated to the Sitecore media library. The benefit here is that, these images can then be referenced in any other custom templates which means less data replication and easier updating of content.

Workflows - Workflows are another one of the features that SharePoint is well known for. Workflows in Sitecore are very easy to setup and the visual aspects of creating workflows makes it a simple task. There are also several workflows included out of the box which gives a good starting point.

User accounts - Sitecore much like SharePoint have their own accounts built into the CMS, active directory accounts and even custom accounts (stored in database or LDAP for example). There should be no issue using the same source for user accounts when migrating from SharePoint to Sitecore.

Programmatic migrations

There are methods available to migrate content from SharePoint to Sitecore, rather than having to move it manually one item at a time. SharePoint offers a service which can be called from within code, with the data then used to create Sitecore items. This method may require some manual intervention to organize/clean the data as required, but should take care of much of the manual migration process.

Conclusion

Sitecore is the market leading CMS with a lot more available out-of-the-box than SharePoint. When planning your migration, it's a good idea to consider what the best way to implement the business requirements in Sitecore would be, and perhaps what else Sitecore may bring to the table that could exceed requirements delivering a stronger solution that ultimately leads to more engaged users.

Sitecore and custom 404 not found and custom error pages

In Sitecore if an page or other media asset is not found, the user is redirected to the default 404 page.
If you wish to show a custom page instead, there are settings which can be configured in the web.config file. Under the "/configuration/sitecore/settings/setting" element there are two settings which control the behavior of the 404 page:

  • ItemNotFoundUrl - When a URL does not correspond to: a content item or Sitecore media item.
  • LinkItemNotFound - When a link inside a rich text field does not exist, the URL is replaced with this value.
  • LayoutNotFoundUrl - For items which does exist but which has not been assigned a layout.
  • ErrorPage - For any general errors in Sitecore.

Friday, July 24, 2015

Sitecore page editor is showing JSON objects on the page

In Sitecore I noticed that when entering page editor mode, that JSON objects were being output all across the page. It did not happen however when not in page editing mode.


In my case this was occuring because the layout file did not contain a form element with runat set to server. John West discusses this error in detail and provides other potential causes on the Sitecore blog.

Thursday, July 23, 2015

SMTP configuration for mail relay on web server

The following errors can occur on a fresh web server where you are trying to send SMTP email in the code (a contact form for example).

  • No connection could be made because the target machine actively refused it 127.0.0.1:25 - SMTP server has not been installed on the server. 
    • Open server manager
    • Click manage > Add roles and Features
    • Select role-based or feature based installation
    • Select the local server
    • Select Features from the left menu (not Server Roles)
    • Check the SMTP Server feature
  • Mailbox unavailable. The server response was: 5.7.1 Unable to relay for test@email.com - because mail relay has not been setup on the server
    • Open the IIS6 Manager
    • Select properties for SMTP Server
    • Select the General tab set the IP address setting to be the servers IP instead of All Unassigned
    • On the Access tab, click the Relay button, then add the server's IP address and 127.0.0.1
  • Unable to read data from the transport connection: net_io_connectionclosed - the web site in IIS is still trying to connect to a SMTP server.
    • Open IIS Manager
    • Select the web site
    • Under ASP.NET select SMTP E-mail
    • Select the Store e-mail in pickup directory option and set the value to C:\inetpub\mailroot\Pickup
    • On the C:\inetpub\mailroot\Pickup directory give access to the account IIS_IUSRS

IIS error - value does not fall within the expected range

A site was stopped in ISS and when I attempted to start it the error "Value does not fall within the expected range" would occur. This error occurred because one of the bindings somehow contained an invalid character (in this case a space). Fixing up the binding then allowed the site to be started.

Wednesday, July 22, 2015

Migrating from Ektron to Sitecore

Introduction

A migration from one CMS to another is no simple task, and if not planned and architected correctly it can lead to a poor implementation of the new CMS and even loss of business critical content, features and security. Ektron as a CMS has a relatively simple development pattern, however implementations can vary which means any migration from Ektron to Sitecore will not be one size fits all. This article will cover the key concepts to consider with your migration to Sitecore and perhaps provide a starting point for the planning process. 

The first step

Before you begin the process of migrating from Ektron to Sitecore, you need to define a high level goal/objective of the migration, as this will greatly affect the process/steps taken. Some examples of high level objectives could be:
  • Like for like migration - in which case, very detailed requirements will need to be created to ensure nothing is missed.
  • New site (reusing majority of old content) - in this case you would create requirements of the new Sitecore site, see which elements (content, code or design) can be migrated from the old Ektron site and to what level these elements can be migrated.
  • Migration of selected content - this may occur when a greenfields site is being created where some selected content (perhaps product information/history or other smart form data) is required but nothing else (page templates, widgets and unwanted content). 

From the top down

Here are a list of common components that will make up an Ektron implementation and an overview of what they might be implemented as in Sitecore.

Pagebuilder template - In Ektron a pagebuilder template allows you to create multiple page layouts (which contain various drop zones for widgets) which then use the same master page. When migrating these to Sitecore, you would consider creating a Layout which is effectively the master page (containing the header/footer for example) as well as a number of placeholders that make up the layout of the content (whether it be columns or grid based). If you have multiple unique Ektron pagebuilder templates (such as 1, 2 and 3 column designs), each of these could be a sublayout which contains placeholders in the desired columns.

Widgets - A widget in Ektron is simply a module which can be added to a page and runs independently from all other elements. These migrate very cleanly over to the Sublayout (web forms) or Rendering (MVC) in Sitecore. The Parameters on Sitecore sublayouts are much more well defined than Ektron, and a DataSource can be set on the sublayout (and locked down to content of a specific type). Sublayouts in Sitecore can also contain placeholders/other sublayouts, which is a nice way of adding commonly grouped sublayouts (page heading & breadcrumbs for example) to a page as a single item. For any widgets on the smart desktop (logged in admin area), you could create a page only accessible to users with specific permissions.

Smart Forms - a Smart Form in Ektron is the method of storing user-defined objects in XML. In Sitecore you would create templates of the same/similar structure and also make use of template inheritance for any fields that are common across the data objects. If you need to keep using XSLT to render the data, you would need to serialize the item to XML in code. For those who want to forget about XML storage and XSLT display - you can access the code as an object in the code and even make use of tools such as Glass Mapper to use custom cleaner object classes. For Smart Forms which allow multiple objects on the same form, I would suggest a parent template in Sitecore which holds many children templates (of the actual object type).

Menus, Taxonomies & Collections - These three types of content in Ektron can all be migrated to templates in Sitecore. For Menus and other types which may be based on existing content, you could either add fields to those existing content templates or even navigate the Sitecore content tree and build up the data programmatically. 

Library - The library in Ektron is what contains all the media items and it mimics the folder structure of the content tree. These items would quite simply be migrated to the Sitecore Media Library, where you would have much more control about how the content is stored and exposed. The migration process is also a great time to clean up the content and give it a good folder based structure + relevant naming/metadata. 

Programmatic migrations

For the migration of content from Ektron to Sitecore, there are methods available to migrate the content using code, rather than data entry people endlessly moving it item by item. The Ektron Framework API can be used to access the Ektron content (smartform data, menus, taxonomies, collections and media library) which can then be massaged into Sitecore templates. This method may require some manual intervention to organize/clean the data as required, but should take care of much of the manual migration process.

You can also user crawlers/scrappers to download Ektron library items (PDFs, images, etc.) which can then be uploaded in bulk to the Sitecore Media Library. 

Conclusion

Sitecore is the market leading CMS with a lot more available out-of-the-box than Ektron. When planning your migration, it's a good idea to consider what the best way to implement the business requirements in Sitecore would be, and perhaps what else Sitecore may bring to the table that could exceed requirements delivering a stronger solution that ultimately leads to more engaged users.

Monday, July 13, 2015

JavaScript font resizing with multiple font sizes

Web Content Accessibility Guidelines or WCAG are a set of accessibility guidelines for web sites. One of these guidelines is SC 1.4.4 (Resize text) which requires the text can be resized by up to 200%. For simple web site that contain a single paragraph class and title class, resizing of the font is simple. However modern designs with multiple elements (including headers, footers, main body, along with other widgets) can be difficult to resize as each element likely has a different font size.

The following piece of jQuery will go through the multiple classes input and increase each font to 1.2 times it's current value.

If you then wanted a decrease function, simply use the example above but set the size to be 0.8 times the current. The plus of 1.2 and minus of 0.8 is not exactly going to scale, but will work closely enough. It is also worth considering saving the current scaled font setting in a cookie, and then applying it on page load.

Sunday, July 12, 2015

Ektron bundling of JavaScript and CSS

An important aspect of web development is optimizing the final product to ensure it loads in a reasonable amount of time. Slower loading web sites are frustrating to users and can lead to higher bounce rates and less time spent on the site.

One of the simplest ways to optimize a web site for faster loading is to look at the number of HTTP requests. That is the number of files needed to be downloaded to render the web page - this includes images, CSS, JavaScript and any custom fonts.

Built into Ektron is the ability to register CSS or JavaScript in the code behind where it gets combined into a single JavaScript file and CSS file (less HTTP requests) and even is able to minimise it (less file size to download).

To bundle JavaScript in Ektron you can use the following code:
JavaScript.Register(this, "/path/file.js");
To bindle CSS in Ektron you can use the following code:
Css.Register(this, "path/style.css"); 
However there is also an Ektron configuration file called "ektron.cms.framework.ui.config" which is located in the web root which needs to be configured to allow bundling and minification.

  • AllowJavaScriptRegistration - Allows JavaScript to be registered in code behind.
  • AllowJavaScriptAggregation - Will the JavaScript be output (bundled) in a single files.
  • AllowJavaScriptMinification - Will the JavaScript be minified - smaller file size but not as readable.
  • AllowCssRegistration - Allows CSS to be registered in code behind.
  • AllowCssAggregation - Will the CSS be output (bundled) in a single files.
  • AllowCssMinification - Will the CSS be minified - smaller file size but not as readable.
It is also possible to have files not aggregate on a single basis. The Register function takes in a third parameter (bool) which controls if it will aggregate or not.
JavaScript.Register(this, "/path/file.js", false);

Wednesday, July 8, 2015

Internet Explorer doesn't render a web site correctly and goes into Quirks mode

I came across an interesting error with Internet Explorer 9 and a modern web site layout (using bootstrap and jQuery). When loading the web site, the style would render completely wrong (and unusable). 

Pressing F12 and looking at the developer console, revealed that the browser mode was IE9, but document mode was set to Quirks. By default web browsers will attempt to display HTML content to the specification of the W3C, quirks mode is a browsers way of attempting to display older web pages (with older standards of HTML).

However when quirks mode is activated for a web site with newer HTML mark-up it will completely butcher the page, due to the presence of new tags and techniques. From my testing I have found the following factors can cause Internet Explorer to enter quirks mode by default:
  1. Any code/comments before the Doctype element in the HTML. The doctype tag "<!doctype html>" should always be the first element on a page.
  2. The following tag should be the first item in your head section, as it basically tells the browser the HTML is up to a given standard.
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>

Sunday, July 5, 2015

Ektron web alerts aren't sending

If you have setup web alerts in your Ektron web site, have updated content with as assigned subscription (that has a user subscribed) and yet to email is generated, it may be due to one/all of these issues.

The main installation for web alerts can be found at: "C:\Program Files (x86)\Ektron\CMS400v91\Utilities\WebAlerts.exe".

  1. On the web alerts tab of the content, ensure that a complete email is being built up. This includes the following elements:
    1. From email address
    2. Subject
    3. Opt out/unsubscribe message
    4. Actual content (message, content link, etc.)
  2. Ensure the Ektron async processor service is running
    1. This can be installed from "C:\Program Files (x86)\Ektron\CMS400v91\EktronAsyncProcessor_Service"
  3. Ensure you have a private queue created named "msmq_web"
  4. The SMTP details for sending of web alerts is not in web.config it is in the config available in "C:\Program Files (x86)\Ektron\CMS400v91\EktronAsyncProcessor_Service"
  5. Disable "Staging Server" on the main site configuration in the workarea.
Ektron 9.1 documentation on web alerts found here.

Tuesday, June 30, 2015

Ektron adding a widget to the smart desktop (admin desktop)

To get a widget added to the smart desktop (aka the admin desktop) of an Ektron web site, you must follow different steps than adding a normal widget which can be added to pages.
  1. Create a widget and save it under /Workarea/Widgets/
  2. In the workarea, navigate to Settings > Configuration > Personalizations > Widgets and click on "Synchronize widgets from /widgets/ folder". This is a misleading button naming, but also syncs the workarea (admin) widgets.
  3. In the workarea navigate to Settings > Configuration > Personalizations > Widget Space and select the "UserSmartDesktop" widget space, here you can select which widgets can be added to the smart desktop.
  4. Now you can go to the "Desktop" tab in the workarea and add the widget to the smart desktop.

Sunday, June 28, 2015

Using the Ektron Framework API (service) from command line or application

The Ektron Framework API provides an interface to interact with an Ektron web site - this may be via another web site or in an application of some kind. Using the service you can access content, users, commerce, settings, search and so on using CRUD (Create, Read, Update and Delete) commands.

Ektron has provided a console application which leverages this framework API, which can be found here. This particular sample is made to work with version 9.1 of Ektron, however it should easily work with any later versions.

Getting the sample solution working

  1. Replace the DLL files with latest versions
    1. Remove all references from the solution
    2. Add the refrences again from the following path: C:\Program Files (x86)\Ektron\CMS400v91\startersites\3TierMin\Content\bin
  2. Replace the ektron.cms.framework.unity.config and instrumentation.config files
    1. The replacements can be found in: C:\Program Files (x86)\Ektron\CMS400v91\startersites\3TierMin\Content
  3. In the app.config change the "ek_ServicesPath" variable to the location of your Ektron installation
  4. In the main program class file, you will need to enter admin credentials to authenticate with the CMS.
The sample solution should then build and when run will create a piece of sample content. From here you are able to modify the code to interact with the Ektron Framework API as required.