Friday, 22 February 2019

Wednesday, 28 November 2018

Sunday, 1 July 2018

All you need to know in order to take your first Sitecore Experience Accelerator(SXA) Site live



1. Start of Journey 

While the temperature was on the upper node and I was enjoying my pseudo bachelorhood as my family went to India. I got a clue my next engagement would be to build, design, develop and deploy the very first Sitecore SXA implementation in the Gulf region. 


As I am the co-founder of Sitecore User Group Dubai http://suguae.net  and we had already arranged the "Sitecore Experience Accelerator (SXA) for Sitecore Developers" Session from KERN HERSKIND I was familiar with SXA and Super excited at the same time.

So this is where my SXA journey Started.

2. Groundwork started 

I started my ground work with Sitecore SXA version 1.5; I have installed the same and started exploring the SXA Capability; Unfortunately apart from official Sitecore SXA documentation more or less all my google result was resulting similar kind of results talking all SXA buzzword and not much detailed information on an individual topic.

This is where I planned and started writing my SXA learning via my blog post and came with a couple of quick blog posts.









3. "Show Case" Helps a lot 

I wanted to explore the way we have Habitat for Helix we definitely must of some solid implementation which acts as a demo site and reveals the hidden gems of Sitecore SXA in real life implementation.

Many thanks for Adam Najmanowicz who has already done the "Showcase" the sample Sitecore SXA Site.

I have found a couple of initial hiccups; However, with Adam Najmanowicz   support I was able to get it up and running. A Detailed blog post is available @



4. "Resourcing was Challange"


While exploring the Market where I could not find a suitable candidate who has the potential to lead the overall Sitecore SXA engagement; Tried Offshore engagement however within few sprints we came to know until and unless and Sitecore Dev team and Front-End Dev Team are not co-located delivering the SXA implementation will be a nightmare. 

During this tough time one fine night, I got a call from one my previous team member eyeing an opportunity in Dubai and within a day it was a deal with Mr. Tahir Ali one of finest Sitecore lead I have worked with. 

We further Ramped up our and done all the Developers onboarding and crus is all of them are co-located.

5. "Zero Code Approach"


While installing "Showcase" I could not find any code base so from Day 1 I was very much clear and keen to build this enterprise level website using "Zero Code Apporch" and we followed the same we wrote very minimal code base.

5. "Over Kill of Page Content and Promo Component"

During our initial implementation, we observed that we just need only page content and promo component and by creating its rendering variant we can develop any markup and get the desired functionality. 

But we reliased this soon and we learned our lessons. 

6. "SXA 1.6 came as relief"

We were almost half on our milestone when Sitecore SXA 1.6 was launched. You can create customized versions of existing SXA components and it has a number of other advantages as compared to 1.5 so we have migrated to SXA version 1.6  More Details can be found here.

Always keep a milestone in your SXA project to migrate to latest version.


7. "Adam Supports are appreciated "


During this entire engagement, we were in constant connect with Adam Najmanowicz  who has done review and lead and monitored this engagement. 

His support is really appreciated and many thanks to him.

8. "IAAS vs PAAS "


The initial requirement was to deploy the solution on IAAS however at the time of delivery business wanted to explore the PAAS option. I will say apart form config tweak from Solr to Azure search this migration went smooth. 


Now the journey has a break to get charged and and as the foundation is already done we will be rolliong out many more SXA sites in upcoming months .

Many Thanks 

Happy Sitecore SXA Journey.

Wednesday, 16 May 2018

Takeaway notes from Azure session on Azure SQL databases

How many SQL instances get created based on your Azure subscription? 


Below is the Component which gets created as per your PAAS Subscription.




For E.g I have created the XP0 single instance and we got the below instance. I have masked the data as usual.




How can I allow my IP or IP ranges in order to connect to Azure sql Database?


Choose your sql database and goto  Firewalls and virtual networks and add your IP ranges as shown below.




How can I change the Resource Configuration & Pricing for given Database?

By Default, as highlighted above all the databases are created as "Standard" Option by means of resource Configuration & Pricing.

Choosing a service tier depends primarily on business continuity, storage, and performance requirements.



considering the retention period, we choose basic for CORE database while resting on a standard 


What you mean by DTU?


DTU Stands for Database Throughput Unit (DTU) and it represents a blended measure of CPU, memory, reads, and writes

In the DTU-based purchasing model, customers can choose between Basic, Standard, and Premium service tiers for both single databases and elastic pools.


What you mean by Elastic pool ?


SQL Database elastic pools are a simple, cost-effective solution for managing and scaling multiple databases that have varying and unpredictable usage demands. The databases in an elastic pool are on a single Azure SQL Database server and share a set number of resources at a set price


  • Its cost-effective model
  • No need of over provision
  • No need to worry about individual performance.
  • Individual databases can be configured


Keep Analytics database separate and rest of the database in one elastic pool.

The steps are very simple:
-Create 1 Azure Sql Server
-Create 4 Azure Sql Databases (and import associated Sitecore databases).


-Create 1 Azure Sql Elastic Pool
-Add to pool the 4 Azure Sql Databases





Monday, 14 May 2018

Takeaway notes from Azure session on Deployment Slots

Q: What is Deployment slot?

Image result for Deployment slots



A deployment slot is an additional Azure App Service Web App instance (W3WP) which is ~bound to your production Azure App Service Web App of the same name and runs on the same App Service Plan.

Deployment slots are also known as staged deployment.

A deployment slot will carry the name of the Azure Web App + the name of the slot.
For e.g  If my Azure Web App is called mysite and I create a slot called staging then its url will be

http://mysite-staging.azurewebsites.net

By default, each Azure Web App has a single deployment slot called production which is the Azure Web App itself.

Please note slot is in itself a regular Azure Web App.

Q: Why Deployment slot?


  1. The development slot helps you to test your code prior to the release of the live Web App.
  2. with just a click the new version is live as deployment slot is swapped with the production
  3. Staged Deployment
  4. Autoswap
  5. A/B testing can be executed using different slots

Q: How many deployment slots?


By default, each Azure Web App has a single deployment slot called production which is the Azure Web App itself.

You can add more than one slot as per your business needs.

Q:  How the configuration works between slots.

By default, App Settings and database connection strings are NOT sticky to the slot and will follow the Web App when the test slot is swapped with the production slot.

We need to make the setting sticky to slots so it does not get swapped.

Image result for Deployment slots









Monday, 8 January 2018

Change the Data to "Data to Local Page" for Sitecore SXA Component

By Default when we try to add a data source for given Sitecore SXA Component It opens the "Sitecore.Shell.Applications.Dialogs.SelectRenderingDatasource" dialog as shown below.



Content Authors team request to if we can change the "Data" which create the local data under the context item to "Local data source" for their own ease.

This can be done with just updating the display name of  "Virtual Page Data" item at given path as shown below


/sitecore/system/Settings/Foundation/Experience Accelerator/Local Datasources/Virtual Page Data/__Standard Values
























It works as shown below.












Monday, 13 November 2017

Sitecore Experience Accelerator :: SXA :: Using Page list Component to Display :: Articles Sorted by Custom Date ::

Let's assume that we have a requirement to build the news component which is similar to shown below.




Basic Business Case was to get the news article sorted by their publishing date.

Alright, let's start some action.


  1. All the news items are stored under /sitecore/content/TEN/WEBSITE/Home/news
  2. Create an item query  /sitecore/content/TEN/WEBSITE/Settings/Item Queries/NewsSortedByDate as shown below
I have used build query mechanism 

template:{Your Template Id};sort:news-published-date





Cool now in Page List Component use the item query in order to list the data as shown below.



The index should be updated in order to have relevant and correct data. Default rendering list the data in list view.

We can use rendering variant in order to customize the look and feel as per business need.

Happy Sitecore SXA.







Monday, 30 October 2017

Sitecore Experience Accelerator :: Restrict the Search Result only for Given Template :: Search Result Component

In case you are in love in SXA and using the Search result component in order to display the result.

Here are quick notes before you start.

Fist and foremost you need to Enable the Lucene or  Solr Search configuration so we can go ahead and index the data.

By Default, all the template which inherits from _searchable is getting displayed in  the

search result.




However, we had a requirement to limit for only given template type so only those search result is displayed.


Cool, this can be achieved using SXA in build scope setting as shown below.


Happy Sitecore SXA.

Wednesday, 25 October 2017

How to call the Subscribe Mail Chimp API from C#


I wanted to do MailChimp subscription. I wanted to do using C# so I did a quick google and get Reference of below Code.

Here are the Steps:

Create one Mail Chimp Account and get the API Key 





Get the list ID as shown below;



using System;
using System.IO;
using System.Net;
using Newtonsoft.Json;
using System.Diagnostics;

namespace MailChimpConfiguration
{
    class Program
    {
        static void Main(string[] args)
        {
            var apiKey = "-us17"; // your API key here
            var listId = ""; // your list ID here
            var subscribeRequest = new
            {
                apikey = apiKey,
                id = listId,
                email = new
                {
                    email = "pradsir@gmail.com"
                },
                double_optin = true,
            };
            var requestJson = JsonConvert.SerializeObject(subscribeRequest);



            var responseString = CallMailChimpApi("lists/subscribe.json", requestJson);
            dynamic responseObject = JsonConvert.DeserializeObject(responseString);
            if ((responseObject.email != null) && (responseObject.euid != null))
            {
                // successful!
            }
            else
            {
                string name = responseObject.name;
                if (name == "List_AlreadySubscribed")
                {
                    Trace.TraceInformation("Mailchimp already subscribed");
                }
                else
                {
                    Trace.TraceError("Mailchimp subscribe error {0}", responseObject.error);
                }
            }

        }


        private static string CallMailChimpApi(string method, string requestJson)
        {
            var endpoint = String.Format("https://{0}.api.mailchimp.com/2.0/{1}", "us17", method);
            var wc = new WebClient();
            try
            {
                return wc.UploadString(endpoint, requestJson);
            }
            catch (WebException we)
            {
                using (var sr = new StreamReader(we.Response.GetResponseStream()))
                {
                    return sr.ReadToEnd();
                }
            }
        }
    }
}

Credit :http://markheath.net/post/how-to-call-the-mailchimp-api-from-c 

Tuesday, 5 September 2017

How to install Sitecore Experience accelerator SXA Learning Site "ShowCase"

What is ShowCase for Sitecore Experience Accelerator.?

What Habitat is for Helix; Showcase is for Sitecore Experience Accelerator.

The showcase was originally created by Cognifide for Zen Garden - a product that later evolved into Sitecore Experience Accelerator. And is currently passionately maintained by Adam Najmanowicz

Here are the Steps in order to do Set up for Showcase.


The Latest cut of Showcase can clone or downloaded from Sitecore Showcase





In my case, I have downloaded the same @ C:\projects\Showcase\Sitecore.XA.Showcase




Launch the Visual Studio with Administrative privileges and open the Solution.

Update the showcase folder in Sitecore.XA.Project.Showcase.User.Config depending upon the location you have cloned the Git Solution as shown below.



Rebuild the Solution and Publish the solution to Root of  Sitecore Instance.In my case it was

C:\inetpub\wwwroot\sitecoresxa\Website as shown below



If all goes fine then go to your Sitecore Instance and Login as Admin.

Now goto http://<yourSitecoreinstancename>/unicorn.aspx


Sync in order to install all the Sitecore item.


If all went fine you can see a tenant called showcase and a site called int as shown below


I found some cosmetic issue while accessing in preview mode.




When connnect Sitecore SXA community over Sitecore SXA Slack  Adam replied that the current Git version is not compatible with version 4 and have provided compatible package as given below

https://1drv.ms/u/s!AmgGEEfpMIP2hqBVhOmhFoFGbVzsCg

Voila all fine as shown below




                                                  
Happy Sitecore Experience Acceleration.                        

Saturday, 2 September 2017

How to Use Login and Logout in Sitecore Experience Accelerator SXA


Open the Sitecore in experience Editor Mode and add login in the Main section while log out rendering in Header section as shown below.





Add the Associated items(Login and Logout)  under given item path as shown below.


/sitecore/content/PradeepNewtenant/myllandingpage/Data/Security




These data source items are useful in order to customise the label, Error Message and Redirection Url post successful login as shown below.

MyLogin                                                                                                                          



MyLogout                                                                                                                




Alright look like all set; let's see how its works in preview mode.  Voila, it works perfectly fine as shown below.

                                 

Isn't it too easy?                                                                                                                                  

Yes, It is very straight forward  However I am pretty much sure you must be having the similar question How to get this working with custom login provider or with federated authentications, etc.

Alright time to do deep dive to find the clue the crux is here.                                                                  


My deep love with latest crush Sitecore SXA continues  :)                                                                   

Happy Sitecore Experience Acceleration.                                                                                           

Thursday, 31 August 2017

How to use Twitter in Sitecore Experience Accelerator SXA 200th Blog

Almost 4 years back I wanted to maintain online diary where I can augment all my Sitecore learning and think of writing blogs so it helps me along with the world wide Sitecore community.

Here comes my first welcome blog  Learning Sitecore CMS Welcome Blog.

Time went like a rocket and did not realize me this current blog post is special and it's 200th blog post for Learning Sitecore CMS.

In today Session I will be covering how to use Twitter in Sitecore Experience Accelerator.

To start with first create one twitter application in Twitter Application Management 




Go to Keys and Access Token and You should be ready with below.

  • Consumer Key (API Key)
  • Consumer Secret (API Secret)
  • Access Token
  • Access Token Secret
Oh, Enough we can't wait for any further without launching Sitecore Launch Pad.



Alright lets Launch Sitecore                                                                                                                  




Open the Experience Editor Mode and add the Twitter Component.



Use existing or New associated content; In my case, I am choosing an existing component as shown below.


The item path for the existing item for me   was as below.                                                                                                                                                       /sitecore/content/PradeepNewtenant/myllandingpage/Data/Twitters/MyTwitter

The actual setting of items is as shown below.




The twitter app credentials need to be augmented @

 /sitecore/content/PradeepNewtenant/myllandingpage/Settings/Twitter Apps/Pradeep Twitter App


 
All done time to see the results.




It works as shown below.




My deep love with my latest crush is Sitecore SXA continues  :)

Happy Sitecore Experience Acceleration.

Tuesday, 29 August 2017

Fixing the Error While Installing Sitecore 8.2 Complete Set Up : The type 'System.Object' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Runtime, Version=4.0.0.0

I face one unexpected issue while installing Sitecore 8.2 using Sitecore 8.2 rev. 160729.exe

I will say unexpected because I have used the same installer in order to install the Sitecore Complete Instance at least 10 times.

The Error is as below

Compilation Error

Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

Compiler Error Message: CS0012: The type 'System.Object' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.

Source Error:


Line 10: @model Sitecore.Mvc.Presentation.RenderingModel
Line 11: @{
Line 12:   var rendering = Html.Sitecore().Controls().
GetUserControl(Model.Rendering);
Line 13:   rendering.Class = "sc-launchpad";
Line 14:   

Source File: c:\inetpub\wwwroot\Habitat\Website\sitecore\shell\client\Applications\LaunchPad\Layouts\Renderings\LaunchBar.cshtml    Line: 12 



As the Error is clearly saying  You must add the Reference to 'System.Runtime

I copied the System.Runtime.dll from below location

C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5.1\Facades

to Bin folder of Sitecore Instance; In my case it was

C:\Inetpub\wwwroot\Habitat\Website\bin






It was relaxed feeling when I saw launchpad screen back



Happy Sitecore