Overall features and concepts of Sitecore Part 1.



Sitecore is booming in the market and most of the business already started using it because of its wide range of features and easy concepts to the marketer and developers to integrate and market the business to the next level.
Let us start to see overall features and concepts in Sitecore that one should be aware.
Based on my experience and analysis of these features i hope this article might help others.

Tagging:
Tagging is the common feature now a day’s people want to group the content, Sitecore provided this feature inbuild and easy to configure it.
Tags need to be created under the following path using the Tag Template.
/Sitecore/system/Settings/Buckets/TagRepository


During Search, if facets need to be updated with this Tag then we need to update the following items enable Field to be checked, Facets will be displayed as GUID so create a computed field to overcome this.
Sitecore/system/Settings/Buckets/Facets/Tag

Caching:
Caching is very essential for sites that consuming more calls to the server. And it will be greatly improving the performance of the site. Sitecore out of box varies caching options to enable at Item Level or at rendering level.

Caching can be even enabled for the site in Sitecore.config (cacheHtml=true)
Sometimes cache won't be cleared for certain websites in a multisite environment, so we have to update the config like below.
<event name="publish:end">
                <handler type="Sitecore.Publishing.HtmlCacheClearer, Sitecore.Kernel" method="ClearCache">
                    <sites hint="list">
                        <site hint="siteA"> siteA </site>
<site hint=" siteB "> siteB </site>
                    </sites>
                </handler>
            </event>
            <event name="publish:end:remote">
                <handler type="Sitecore.Publishing.HtmlCacheClearer, Sitecore.Kernel" method="ClearCache">
                    <sites hint="list">
                        <site hint=" siteA "> siteA </site>
                        <site hint=" siteB "> siteB </site>

                    </sites>
                </handler>
            </event>

There are certain admin tools which help to clear the cache.
We can also customize this cache clearing process.


Events:
Events are one of the important features that most of the functions carried out in Sitecore and we can also customize/add for our needs.
These events are also helpful to handle remote triggering from one environment to another like CM and CD, it internally uses Eventqueue to handle any remote event triggering which is always stored in the Core database, which will be useful as mostly we will be having only one core database for our website even in a load-balanced environment.
Example:
If you want to clear cache from a CD we can publish an item from CM which will clear cache in CD using events.

Commands:
This feature will be very useful if some new actions need to be performed in Sitecore.
Example:
Suppose we are storing some user information to a database and now content authors need to get the information of the user details stored in the database, so if we provide any button interface to get the data from the database will be very useful for them.
This below class Type and namespace needs to added to the core database and need to add the button to the Ribbons
[Serializable]
    public class ExportRegistrationDetails : Command
    {
        public override void Execute(CommandContext context)
        {
            Sitecore.Context.ClientPage.Start(this"Run", context.Parameters);

        }
        public static void Run(ClientPipelineArgs args)
        {
            if (!args.IsPostBack)
            {
                UrlString urlstring = new UrlString("/ExportRegistrationDetails.aspx");
                SheerResponse.Eval(string.Format("window.open('{0}');", urlstring.ToString()));
                args.WaitForPostBack();
               
            }
            else
            {
                if (args.HasResult)
                {
                    if (Sitecore.Context.Item.Name == "Content Editor")
                    {
                        Sitecore.Context.ClientPage.ClientResponse.SetLocation(Sitecore.Links.LinkManager.GetItemUrl
                            (Sitecore.Context.Item));
                    }
                }
            }
        }


In Core Database add the Export To Excel Command by the following steps.

Update the Sitecore.commands.config to add this command just created in core Database.
 <command name="app:exportexcelregistrationdetails" type="xxxxxx.Feature.Forms.Pipeline.ExportRegistrationDetails,xxxxxxxxxxxxxxxx"/>


Custom Fields:
Custom fields are useful if some of the out of box field is not able to solve our problem.
Once created the custom field in core database map it to the template field in master database, and if that field gets indexed it is important to add that field details to FieldType.config and also to index configuration file to add this field to be indexed.
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <fieldType name="CustomField" type="xxxxxxxx.customfield,xxxxxxxxxxxx" />
</configuration>


Workflow:
Workflow is important part in content management system, as it is necessary to monitor temploraray content which is not yet reviewed published to Content delivery.
Workflow can be created using the following template under the path (/sitecore/system/Workflows)
/sitecore/templates/System/Workflow/Workflow


Workflow fundamentals:
All items in sitecore which use workflow should go from one state to another.
User can edit the item and publish it if he has necessary to write access to those items.
It has a Final property to make it as the final State, which needs to be selected only if it is a final State.
It is used to push item from one workflow state to another state using “Next State” defined by either accepting or rejecting the workflow state modification request.
During command executes we can define certain action like sending email, Validation and publishing etc.
During Publishing it gives importance to the Parameters field to look for any condition available to be continuing to publish. They are
Smart – (It does smart publish, and its value will be either 1 or 0 (smart=1)
Related – (It publish the item with related items, Its value will be either 1 or 0 (related=1)
Deep – (It publish the item along with all levels of its child’s, Its value will be either 1 or 0 (deep=1)

Publishing:
Publishing is very important to move the approved items from one environment to another like from CM to CD.
Publishing mainly involves the following options.
·        Site publishing:
Using this option, we can publish the entire site including rendering, templates, layouts, and content items, etc.
·        Item Publishing:
Using this option, we can publish only the specific item and its child based on the option selected.
// Programmatically publish
                    Sitecore.Publishing.PublishOptions publishOptions = new Sitecore.Publishing.PublishOptions(
                    item.Database,
                    Sitecore.Configuration.Factory.GetDatabase("web"),
                    Sitecore.Publishing.PublishMode.Smart,
                    item.Language,
                    System.DateTime.Now);
                    // Perform the actual publish
                    Sitecore.Publishing.Publisher publisher = new Sitecore.Publishing.Publisher(publishOptions);
                    publisher.Options.RootItem = item;
                    publisher.Options.Deep = false;//Include all children for publish
                    publisher.Options.CompareRevisions = false;//Specify to do smart (false) or republish(true)

                    publisher.Publish();
Publishing performance can be improved by the following the below approach:
·   Dedicated publishing instance which will only be dedicated to doing publish a job, It is the replica of the CM      server and it does the job.
In All CM server except Publishing instance server the following Settings needs to be updated to point the Publishing Server details to “Scalabilitysetting.config”
<setting name="Publishing.PublishingInstance">
    <patch:attribute name="value"></patch:attribute>
</setting>
                 ·    Publishing Service(it is the separate .net core service application which will handle the                            Publishing, and it will very fast be compared to another kind of publishing, it will installed as a module.
            
Buckets:
Buckets are one of the important features of Sitecore which allows Sitecore item to hold many child items under it, usually, it is important to go for a bucket when we have child items more than 100.
It can be enabled at the Template level and item level also.
It will improve content editor performance. Buckets hide all the child items under the main item, but it provides easy to access the child item which we are looking through the search option on the actual item.

By default, all the child items will be stored as date split folders but can customize the Bucket folder name where the child items getting stored by the following approach
·   BucketFolderPath configuration setting
<setting name="BucketConfiguration.BucketFolderPath" value="yyyy\/MM\/dd\/HH\/mm"/>
·    Rules (we can use existing rules also we can create our own by inheriting from RuleAction with the generic constraint to allow only BucketingRuleContext

Example:
public class CutomFolderPath : RuleAction where T : BucketingRuleContext
    {

        public override void Apply(T ruleContext)
        {
                             
        }
}
Buckets Url path can be customized using ItemResolver and custom Linkmanager

Wildcard Items:
Sitecore introduced the concept of wildcard items which is a very powerful feature.
It is defined as “*” item in the content tree. Which will load this item if the URL matches item of this level.
This wildcard item will be useful when we need to display items with different datasource without creating multiple page item with presentation details along with its datasource for each one of them.
This * item will be the universal item which has all presentation details defined, so dynamically passing the datasource to this * item will load this page with different datasource content
Implementation:
public class WildcardDatasource : GetRendererProcessor
{
    public string RenderingName { getset; }

    public override void Process(GetRendererArgs args)
    {
        if (args.PageContext.Item.Name == "*" && args.Rendering.RenderingItem.Name=="renderingname")
        {
            var url = args.PageContext.RequestContext.HttpContext.Request.Url;
            string datasourceItem ="/sitecore/content/site/data/Product" + url.PathAndQuery.Substring(url.AbsolutePath.LastIndexOf("/") + 1);
            args.Rendering.DataSource = datasourceItem; 
        }
    }
}
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
       <sitecore>
             <pipelines>
                    <mvc.getrenderer>
                           <processor type="xxxxxxxx.wildcard, xxxxxx" patch:before="*[@type='Sitecore.Mvc.Pipelines.Response.GetRenderer.GetViewRenderer, Sitecore.Mvc']">
                                 <renderingname>renderingname</renderingname>
                           </processor>
                    </mvc.getrenderer>
             </pipelines>
       </sitecore>
</configuration>

Compatible Rendering:
Sometimes we need a different format of the data to be displayed in the pages. And that should make the content author choose from the different rendering options available for the same kind of data to get more end-user attraction.
This will be easily configurable for the rendering item where we need to have compatibility rendering options.
Goto Rendering item and look for Compatibility Rendering multilist and select the rendering that needs to be added.

This rendering will be easily able to select in Experience editor and in content editor Presentation details

Custom Experience Buttons and Edit Frame Buttons:
Sitecore provides an option to design the page on the go for the non-technical persons using the feature called Experience Editor, using this feature one can design the page and also edit any rendering fields, but it will be sometimes difficult for them when we have some complex field like Treelist etc.
So, these 2 buttons provide the option to edit the required rendering at ease.

EditFrame: /Sitecore/content/Applications/WebEdit/Edit Frame Buttons
Edit Frames require extra code to be added to your view and are designed to surround a section(s) of your view.
In Field Editor Button which is created look for Fields Field and add pipe separated fields that need to edit.
@using (Html.BeginEditFrame(RenderingContext.Current.ContextItem.Paths.FullPath, "Button Name""Display Title"))
{
    // Fields that need to be edit
}
Custom Experience Buttons: /Sitecore/content/Applications/WebEdit/Custom Experience Buttons
 Custom Experience buttons appear on the existing toolbar that will be displayed when you select a component in the experience editor

In Field Editor Button item which is created, look for Fields Field and add pipe separated fields that need to edited on experience editor.
Once done we need to add this button to rendering that will be using it under the field “Experience Editor Buttons



Tokens:
Tokens are very important feature in Sitecore ($name, $id,$parentname,$date,$parentid,$time,$now).
Tokens will be replaced with the value in items fields, we need to create tokens to the template’s standard values before item creation then only this token will be replacing with actual value. Item duplicate will also not work.
We can also create some custom events.
public class CustomToken : ExpandInitialFieldValueProcessor
    {
        /// <summary>
        /// This custom token is used to retrieve and replace the values in the standardvalues with respective values
        /// </summary>
        /// <param name="args"></param>
        public override void Process(ExpandInitialFieldValueArgs args)
        {
            switch (args.SourceField.Value)
            {
                case var token when token.Contains("$parenttitle"):
                    //Replacing the $parenttitle with its parent item's Title Field
                    args.Result = args.TargetItem.Parent != null ? args.Result.Replace("$parenttitle", args.TargetItem.Parent[CommonConstants.Title]) : string.Empty;
                default:
                    break;
            }

        }
    }
Alias:
One of the features in Sitecore is to create Alias URL for any lengthy URL which is very difficult to remember, it needs to be configured each item individually if you need to have an alias for that item.
It is easy to configure.
Click the item and clickà PresentationàAlias add the respective alias for this item, this will be get stored under /sitecore/system/Aliases


Email Experience Manager (EXM):
 Email Experience manager is the savior for the marketer who can send different email campaigns to their contacts without any hurdle.
It provides the 2 campaigns options to send campaign emails

Automated (It provides an ability to send email to the contacts automatically and content author won’t have control on this, the campaign as this is triggered by Sitecore Forms Submit Action or Marketing Automation)

Regular email (Emails sent to the list of contacts specified by the content author, where all included contacts will be receiving emails if it is not in exclusion list)

EXM uses the List manager to get the contact details to send the details also using EXM we can able to create Lists in the List manager.
It can provides to import already defined HTML file as an email message, again we can able to add our rendering to this HTML file to make it more customizable.

Which can be implemented as below.
·        Open the HTML file before importing to EXM, add a placeholder to renderings
       <sc:Placeholder Key="exm " runat="server" />
·     Click on Message --> Body Field -->Email -->Details and add your renderings.

It Provides predefined token which will be used at the time of message composing.EXM also be used by Marketing Automation to send Campaign messages.
Configuring CustomSMTP can be achieved through the updating SMTP setting in Sitecore.EDS.Providers.CustomSMTP.config, but it is good to have a patch configuration.
update the setting in web.config
   <add key="eds:define" value="CustomSMTP" />
   <add key="exmEnabled:define" value="yes" />

Tokens:
if we want to use a field from Sitecore Forms as a token instead of default tokens available.


 Format of the token to be used in EXM
"$form_+SitecoreFormfieldName" ex) $form_designation$
To get all the Form fields to use this Token "$formFields$"

List Manager:
List manager is very useful in storing and retrieving contacts, there are different ways to create a list.
·        Segmented List (It contains a filtered list of one or more selected contact lists by certain matching rules) List can be created from the from Existing List or Sitecore contacts
·        Contact List (A contact can be a member of one or more contact lists, A list can be created from existing Contact List also)
These contacts will be useful for certain marketing Tools in Sitecore like (EXM, Marketing Automation, etc.)
Using List Manager, we can manage Contact List (Remove Duplicate Contacts, delete a contact, Export Contacts, Add Contacts, etc.)

Experience Profile:
It provides a detailed view of contact who interacted with the website/pages, we also able to know all the below performed activities by the contacts
  •    Goals Triggered
  •    Events raised
  •    Visits
  •    Campaigns
  •    Outcomes
  •     Profiles
  •     Keywords
Based on all this information it will be helpful for the marketer to identify what different target customers interest and needs to make them available, it also helps the business to understand the future market situation and act accordingly.
Note:
·       If None of the contacts shows on the dashboard then check whether the Xconnect Search Indexer service is started in windows if not start it.
·       Also verify the connection string which pointed to correct solr xdb index.
·       Update the config file (ScXconnectSite/ App_Data\jobs\continuous\IndexWorker\App_Data\config\sitecore\SearchIndexer/ sc.Xdb.Collection.IndexerSettings.xml) to index anonymous contacts
 <IndexAnonymousContactData>true</IndexAnonymousContactData>

Experience Analytics:
Sitecore Experience Analytics provides overview reports and detailed reports for marketers and marketing analysts to identify patterns and trends in experience data collected from their websites and potentially other external data sources.
Experience Analytics contains the following categories of reports:

·       Dashboard – provides an overview of key analytics by displaying a selection of charts and performance indicators.
·       Audience – helps you gain an understanding of who your visitors are.
·       Acquisition – shows you what is driving traffic to your website. For example, campaigns and other marketing channels.
·       Behavior – helps you to analyze the behavior of your visitors to understand how they interact with your content.
·       Conversions – the percentage of visitors that achieve a goal. This helps you understand how well your marketing efforts are working.

Federated Experience Manager:
It is one of the important features that we can use for non-sitecore applications. We can able to achieve the following to external application.
·       Add different sitecore rendering to the external website
·       Multilingual support for the content rendered from sitecore
·       Able to assign tracking functionality to the pages (Goals, Campaigns, Events, Profiles and Outcomes etc.)
We can apply this feature to the external site by simply placing the beacon scripts generated after creating FXM for the external sites.
<script src="//xxxxxxxxxxx.local/bundle/beacon"></script>
Once it is placed to the external site, we can add or update the rendering using Experience Editor.
Analytics of this external sites will be captured in Experience Analytics Dashboard.

Note:
  • FXM won't work properly in SPA Application
  • Both Sitecore Applications and external sites should use the same protocol.

Sitecore Forms:
Sitecore has introduced Sitecore Forms from Sitecore 9 onwards which is not an external module and it is now out of box, so it is easy to configure it,
Before Sitecore Forms, Sitecore Supports Web Form For Marketers (WFFM) which is an external the module which needs to be installed, but Sitecore forms don’t comes with a lot of out of box Submit action which is readily available in WFFM.
Sitecore Forms capture the information easily from the contact and does the necessary action against these details, we can able to add our custom submit action to do custom processing on the data submitted.
Sitecore Forms helps the marketers to designs own campaigns forms without much need of developer.
Sitecore Forms provides the ability to view the performance of the Forms which provides information like.
  •  Unique Views (Number unique visitor used this Form)
  •  Abandonments (Contact who not submitted the form)
  •  Abandonment rate (Percentage of non-submission of the form)

Custom Submit Action:
Some of the out of box Submit Action will be not sufficient for our requirement, so we have to customize the submit Action to achieve the required functionality.
Custom Submit action needs to be inherited from SubmitActionBase.

Refer the this Sitecore Forms with Mailchimp integration for creating Custom Submit Action to store Forms details to MailChimp subscriber List.

Note:
Sometimes after creating Forms it won’t be displayed in Forms Designer so in order to resolve this issue follow the below steps.
·             Rebuild the “sitecore_master_index” and check back.
·             Check the core database find /sitecore/client/Applications/FormsBuilder/Components/Navigation/Create/PageSettings/CreateFormDataSource/SearchConfig
·          In Field “Root” get the GUID and find this Item available in Master database (this GUID belongs to Forms Item “Sitecore/Forms”) 


Path Analyzer:
The Path Analyzer is an application that enables you to create a map that shows the sequential paths that contacts take as they navigate through your website. You can see the paths that contacts take while interacting with campaigns, and trigger goals and outcomes.
Creating the Custom Map is possible for the following.
·        Page Maps (Page maps are built from sequences of page visits within a given interaction)
·        Goal Maps (Goal maps are maps configured around converting a specific goal)
·        Assets Maps(map configured to show the paths that contacts take to download or interact with a particular digital assets)
·        Campaign Maps (A map that shows path experiences for contacts coming from a specific campaign)
·        Channel Maps (Channel maps let you create a page map for all interactions from a particular channel)
·        Experience Maps (Experience maps can include other interaction attributes, such as channels, campaigns, goals, events, and outcomes)
·        Outcome Maps (Outcome maps let you create a page map leading to a particular outcome)

Let’s create Goal Map and will deploy it to see the results.

In the Part 2 we will see the below list of Topics

  • Marketing Automation
  • Sitecore Cortex
  • XConnect
  • Universal Tracker
  • Sitecore Powershell(module/code)
  • Whats new with Sitecore 9.2
  • Glass mapper
  • Dependency injection
  • Sitecore API

Comments

Popular posts from this blog

Custom Item Url and resolving the item in Sitecore - Buckets

Fixing Sitecore Buckets folder path - Items created after 12 AM server time zone

Sitecore Search - API Crawler with Edge Pagination