Sitecore Item Audit Tool

We have come across many times when we were asked to audit the Sitecore application, which includes Sitecore content audit and solution audit and provide a summary of the complete implementation and see if everything is done as per Sitecore best practices or some compromises has been done.

This article is focused towards item audit which includes checking the templates/renderings/placeholders/content and many other aspects of the Sitecore content tree and item management.

As i got this request quite few of times now- so i thought let’s try to build a tool which can help us is understanding the Sitecore content(item) side of it and give us some actionable items to look and see if there is any scope to improve.

The main idea behind building this tool is to at least get some details from different Sitecore content  types and check if everything is well in place, normally when we review the existing Sitecore implementation these are some of the things which comes to our mind, which includes:

  1. How many page templates exists and how many of them are actually used.
  2. How many data/features templates exists and again how many of them are actually used.
  3. If standard values has been set or not.
  4. If insert options are set
  5. If template icon is set
  6. Different rendering available and if datasource-location and datasource template has been set if it’s a global rendering.
  7. If placeholders allowed controls are set to make sure we can add the components from Experience Editor and etc.

The tool is aligned to solve above points only and it’s just a start, i will continue to make updates to the tool to make it more useful.

Git-hubhttps://github.com/ankitjoshi/Sitecore-Item-Audit-Tool

Sitecore Marketplace-  https://marketplace.sitecore.net/en/Modules/S/Sitecore_Item_Audit_Tool.aspx

How to use:

AuditToolHome

There are different parameters on which you can generate the report, as i mentioned above report is based on:

  1. Page templates
  2. Data templates
  3. Feature templates
  4. Renderings
  5. Placeholders

Fields description:

  • Root path/ID(Page Items)- This field is to specify Path or ID under which your page items(which has presentation) exists. For example- If you site structure is Sitecore->content->home (under which you have all your page items) then you would have to set the ID of home item or path of home item to this field.
  • Page template folder path/ID- This field is to specify the folder path or ID under which you have your page templates created, for example- if your template structure is- /sitecore/templates/Project/SiteName/Page Types, then you would have to set this path or ID of this to this field. If you have multiple locations where your page templates are stored, then you can pass multiple IDs or paths to this field. Root path/ID(Page Items) field is required to show the correct report of page templates and once done you will have the following details from each template:

PageTemplateReport

  • Page template folder path/ID to exclude– This field is to specify the folder path or ID which you want to exclude from your Page template report. Note– Only one path/ID is allowed to set here.

So- now when we have access to this page report we can see what are the things missing and what is required to fix them, Also- it’s not that we have to fix all the highlighted items as few things are requirement based, but this report provide you that starting point which you need to make your implementation follow best practices.

Similarly we have other reports also, for example- Data template report.

  • Root path/ID(Global Items)- This field is to specify Path or ID under which your data items(global/data items) exists. For example- If you site structure is sitecore->content->Global (under which you have all your global items) then you would have to set the ID of Global item or path of Global item to this field.
  • Data template folder path/ID- This field is to specify the folder path or ID under which you have your data templates created, for example- if your template structure is- /sitecore/templates/Project/SiteName/Content Types, then you would have to set this path or ID of this item to this field. If you have multiple locations where your data templates are stored, then you can pass multiple IDs or paths to this field. Root path/ID(Global Items) field is required to show the correct report of data templates and once done you will have the following details from each template:

DataTemplateReport

  • Data template folder path/ID to exclude- This field is to specify the folder path or ID which you want to exclude from your data template report. Note- Only one path/ID is allowed to set here.

This is how feature template report look if you solution is helix based:

FeatureTemplateReport

Renderings Report:

RenderingsReport

Placeholders Report:

PlaceholdersReport

Common folder template Report: (Items that are based on default folder template)

CommonFolderTemplateReport

We can generate the report based on our requirement, if we want to generate the page template report from specific location and you don’t want to include all the templates, you can just select that specific folder item and generate it.

I will keep adding more features/improvements to it based on the feedback, but i am sure this as our preliminary audit can give us a good visibility about the item management and best practices.

Please let me know for any questions.

Happy learning 🙂

Sitecore profile and pattern cards

Recently we were discussing around Sitecore personas, profile cards and pattern cards on how we can provide a connected and relevant user experience to our end users based on behavior and activities performed by the user on the site.

I later created a video of that so that it can be used as reference by others when needed,  here is the video from my youtube channel.

 

Hope it helps!!

Happy learning 🙂

Installing Sitecore 9.2 using Sitecore Install Assistant (SIA)

So we have Sitecore 9.2 available now, with Sitecore 9.2 we have two options to install :

  • Sitecore Installation Framework (SIF) and
  • Sitecore Install Assistant (SIA)

Sitecore Installation Framework (SIF) is the same old way to Install Sitecore since version 9, as part of this post i would like to go over the new way to Install Sitecore i.e using Sitecore Install Assistant (SIA)

So- let’s get started.

Step 1: Download the files (SIA)

You can download the Installation files from here- https://dev.sitecore.net/Downloads/Sitecore_Experience_Platform/92/Sitecore_Experience_Platform_92_Initial_Release.aspx (Please login before downloading the files)

SIA-Step1

Step 2: Create resources folder and extract the files there.

In my case i have created folder SIA under “D:\Deploy\SC9Install”

SIA-Step2

Step 3: SIA Config Updates

Before you run and execute setup.exe file you can update some of the settings of SIA using setup.exe.config file and some of the settings which you can update are as follows:

  • SQL Server name
  • SOLR URL
  • SOLR root
  • Solr Serverice

Step 4: Time for action

Right click on setup.exe and click on “Run as administrator” and you will be prompted with welcome screen where you will have basic details on what’s required to complete the installation successfully. Click on start and you will be navigated to prerequisites screen.

SIA-Step4-1

 

SIA-Step4-2.1

Click on Install and wait for all the prerequisites to get installed.

SIA-Step4-2.2

Once all the prerequisites are installed you can see the below screen:

SIA-Step4-2.22

Click Next and proceed for Sitecore Settings, populate the details which includes solution prefix, admin password and license file.

SIA-Step4-3

Click Next and populate SQL server details

SIA-Step4-4

In the next screen verify the SOLR details, if you have updated setup.exe.config file with the SOLR details it will be pre-populated for you here:

SIA-Step4-5

In the summary screen validate the details and make sure everything is correct.

SIA-Step4-6

Next screen- validate if we are good to proceed for the installation.

SIA-Step4-7

Click on Install, it will take a while to install.

SIA-Step4-8

And FINALLY

SIA-Step4-9

 

SIA-Step4-10

You can now login to Sitecore:

SIA-Step5

And with this we can also see the new SITECORE in the login screen 🙂

Hope this helps!

Happy learning 🙂

References:

https://dev.sitecore.net/Downloads/Sitecore_Experience_Platform/92/Sitecore_Experience_Platform_92_Initial_Release.aspx

 

Setup and Install SOLR 7.5.0 for Sitecore 9.2

It’s super easy to Setup SOLR 7.5.0 for Sitecore 9.2 and with the gist shared by Mark Cassidy  here, it will take just few seconds to install and make SOLR up and running.

solr7.5-default-script

I have used the same and updated few parameters like:

  • Solr Port
  • Solr Host
  • Solr Version (7.5.0)- (This is prerequisite for Sitecore 9.2)
  • OpenJDK Version

Ran the script and few seconds later SOLR 7.5.0 was up and running.

solr-7.7.0ps

SOLR admin was up and running.

solr-7.5.0-admin

Thanks to community members contributions.

Hope this helps!

Happy searching 🙂

References:

you-must-have-a-user-with-the-same-password-in-master-or-target-server error while installing Sitecore 9.0.2 in SQL 2017-fixed

Recently I upgraded my machine and installed SQL Server 2017 and after upgrade i got stuck in well known “same password in master or target server” error while installing Sitecore 9.0.2 instance.

Unable to connect to master or target server ‘sitenameXP_Processing.Pools’. You must have a user with the same password in master or target server ‘sitenameXP_Processing.Pools’.

SQL Version:

Microsoft SQL Server 2017 (RTM-CU15) (KB4498951) – 14.0.3162.1 (X64) May 15 2019 19:14:30 Copyright (C) 2017 Microsoft Corporation Express Edition (64-bit)

Sitecore 9 setup was not new but there was something different with SQL Server 2017.

All the installation prerequisites were in place, checked this post by BrandonMBruno and this was good too.

Microsoft Web Deploy dynamically loads SQL Server Data-Tier application framework, SQL ScriptDOM and SQL CLRTypes components using automatic version detection but in my case Web Deploy has not installed the correct version of SQL Server Data-Tier application framework.

So- I installed the correct version of SQL Server Data-Tier application framework from here:  https://www.microsoft.com/en-us/download/details.aspx?id=56508

This fixed the issue for me, so i would suggest to check if you have the correct version of SQL Server Data-Tier application framework installed if you run into similar issue.

Hope this helps!

Happy learning 🙂

References:

 

Disable index rebuild while installing sitecore package

Package-Install

If you also came across issue with failed package installation/taking lot of time to install because of the no of items package contains and the background activity it performs like index rebuilding- there are two options you can choose from to install Sitecore package successfully:

  1. Disable Index Rebuild while installing Sitecore package.
  2. Install package using SPE (https://doc.sitecorepowershell.com/).

Disable Index Rebuild while installing Sitecore package: In this option you can add/deploy a patch to temporarily disable index rebuild and set the indexing strategy to be manual. once the package installation is done this patch can be removed.

Disable-Index

We need to specify the indexes available and set the index update strategy to manual.

Install package using SPE: This option is handy and can be used as an alternative to install the package, here is the script which can be used to install package with SPE.

We can also disable index rebuild while installing the package.

PS master:\> Install-Package -Path SitecorePowerShellConsole.zip -InstallMode Merge -MergeMode Merge

This has saved lot of our time and you should give it a try if your package installation is taking a lot of time and failing.

Hope this helps!

Happy learning 🙂

 

Reference(s):

https://doc.sitecorepowershell.com/appendix/packaging/install-package

Sitecore Experience Profile stopped working

Recently i got an issue where i see Sitecore Experience Profile stopped working and was not showing any records (not even Anonymous!!).

xProfile-Launchpad

Here are the things which i tried:

Enable Anonymous contacts:

  • In order to enable and show anonymous contacts in Experience profile navigate to xConnect root path.
  • Go to xConnectRootPath\App_data\jobs\continuous\IndexWorker\App_data\config\sitecore\SearchIndexer.
  • Open sc.Xdb.Collection.IndexerSettings.xml and set the value of IndexAnonymousContactData to true.

<IndexerSettings>
<Type>Sitecore.Xdb.Collection.Indexing.IndexerSettings, Sitecore.Xdb.Collection</Type>
<LifeTime>Singleton</LifeTime>
<Options>
<!– Indexer will split change set on chunks to improve memory consumption. Setting this option to 0, a negative value or removing the element completely, results in no splitting.–>
<SplitRecordsThreshold>25000</SplitRecordsThreshold>
<IndexPIISensitiveData>false</IndexPIISensitiveData>
<IndexAnonymousContactData>true</IndexAnonymousContactData>
</Options>
</IndexerSettings>

Fixed- Access to the registry key ‘Global’ is denied Issue:

Enabling Anonymous contacts didn’t solve the issue and profile records were still not visible, when i checked logs- i see the below error:

Access to the registry key ‘Global’ is denied” error

Exception: System.UnauthorizedAccessException
Message: Access to the registry key ‘Global’ is denied.
Source: mscorlib
at Microsoft.Win32.RegistryKey.Win32Error(Int32 errorCode, String str)
at Microsoft.Win32.RegistryKey.InternalGetValue(String name, Object defaultValue, Boolean doNotExpand, Boolean checkSecurity)
at Microsoft.Win32.RegistryKey.GetValue(String name)
at System.Diagnostics.PerformanceMonitor.GetData(String item)
at System.Diagnostics.PerformanceCounterLib.GetPerformanceData(String item)
at System.Diagnostics.PerformanceCounterLib.get_CategoryTable()
at System.Diagnostics.PerformanceCounterLib.CategoryExists(String machine, String category)
at System.Diagnostics.PerformanceCounterCategory.Exists(String categoryName, String machineName)
at System.Diagnostics.PerformanceCounterCategory.Exists(String categoryName)
at Sitecore.Diagnostics.PerformanceCounters.PerformanceCounter.CanBeCreated()
at Sitecore.Diagnostics.PerformanceCounters.PerformanceCounter.InitializeCounter(Boolean reset)

To fix the above issue:

  • Open Computer Management –> System Tools –> Local Users and Groups –> Groups –> Performance Log Users
  • Add the identity to the Performance Log Users group.Performance-Log-Users
  • Restart AppPool for the XConnect website

Rebuild the xDB search index:

I rebuild the search index but this didn’t fixed the issue.

XConnect Avatar Facet Issue:

After some time we realized that the previous contacts are visible but only new contacts are not visible in the Experience profile and we also observed below error in the logs.

Sitecore.Xdb.Collection.Failures.DataProviderException: *** [xdb_collection.GetContactsChanges], Line 27. Errno 50000: Sync token is no longer valid for [Contacts] table. —> System.Data.SqlClient.SqlException: *** [xdb_collection.GetContactsChanges], Line 27. Errno 50000: Sync token is no longer valid for [Contacts] table.
at System.Data.SqlClient.SqlCommand.<>c.<ExecuteDbDataReaderAsync>b__180_0(Task`1 result)
at System.Threading.Tasks.ContinuationResultTaskFromResultTask`2.InnerInvoke()
at System.Threading.Tasks.Task.Execute()
— End of stack trace from previous location where exception was thrown —
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Sitecore.Xdb.Sql.Common.Extensions.DbCommandExtensions.<>c__DisplayClass1_0.

When we checked this we found this the similar issue has already been reported by Rodrigo Peplau here- http://blog.peplau.com.br/en_US/xconnect-avatar-facet-breaking-experience-profile/

This issue is related to image length which has been uploaded in the Profile section of contact- when we removed the Avatar facets issue got fixed.

Our Sitecore version was 9.1 Initial release– however we didn’t observed this issue in Sitecore 9.0 versions.

Rodrigo Peplau has also provided the fix for this issue here- http://blog.peplau.com.br/en_US/part-2-xconnect-avatar-facet-breaking-experience-profile-follow-up/

Happy learning 🙂

Add contact image to experience profile in Sitecore 9

Adding contact image in Sitecore 9 is pretty straight forward, you might come across the requirement where you have to update the contact profile image in xProfile based on contact social profile or custom image URL.

xProfile-Image

Below code can be used to set the profile image using Avatar Facet.

var trackerIdentifier = new IdentifiedContactReference("xDB.Tracker", Sitecore.Analytics.Tracker.Current.Contact.ContactId.ToString("N"));
using (XConnectClient client = Sitecore.XConnect.Client.Configuration.SitecoreXConnectClientConfiguration.GetClient())
{
var contact = client.Get<Sitecore.XConnect.Contact>(trackerIdentifier, new Sitecore.XConnect.ContactExpandOptions());
if (contact != null)
{
    var profileImageUrl = "profile URL comes here";
    var objWebClient = new System.Net.WebClient();
    byte[] profileImageBytes = objWebClient.DownloadData(profileImageUrl);
    string mimeType= "image/jpeg";
    client.SetFacet<Avatar>(contact, Avatar.DefaultFacetKey, new Avatar(mimeType, profileImageBytes)
    {
        MimeType= mimeType,
        Picture= profileImageBytes
    });
    client.Submit();
}
}

Hope this helps!

Happy learning 🙂

 

Sitemap xml multiple languages support with Sitecore SXA

When working with multilingual websites you might want to tell google about localized versions of your pages so that it helps google to point users to the most appropriate version of your page by language or region, you can find more details about this here.

If you are already into Sitecore SXA 1.6-  the feature is inbuilt and doesn’t needs any customization- see the Sitecore SXA 1.6 release notes here for ref., but if you haven’t upgraded yet you have to write some custom code to support this configuration/feature.

In this case what we have to do here is:

  1. Create a new class that inherits from SitemapGenerator (part of Sitecore.XA.Feature.SiteMetadata )
  2. Override BuildSitemap() method.

You can write your own code under BuildSitemap() method and generate the customized sitemap.xml to support multiple languages.

Once you make this change- you will see sitemap.xml in the below format (below example shows three language versions of home page)

sitemap-multilang

Hope this helps and you can use this solution until you move to SXA 1.6.

Happy learning 🙂

Sitecore Experience Commerce eLearning Course 100/200- Complete

Recently i completed Sitecore Experience Commerce 100 and 200 level course and i must say it’s definitely worth taking these courses.

Sitecore Commerce

If you are new to Sitecore commerce and would like to explore and get an understanding of the big picture- this course is for you, after taking Sitecore Experience Commerce 100-Overview and Sitecore Experience Commerce- Essentials course i feel much confident and i can use the info/details i got from the two course to drive my passion towards Sitecore Commerce journey.

If you want to get started with the Commerce here are the courses available to get you started:

  1. Sitecore® Experience Commerce™ 9 100: Overview
  2. Sitecore® Experience Commerce™ 9 200: Essentials
  3. Sitecore Experience Commerce 9.0 300: Developer

From the course contents perspective- here are some of the things which you see there and lot more.

Sitecore® Experience Commerce™ 9 100: Overview

  • Getting Familiar with Sitecore® Experience Commerce™
  • Managing the Catalog
  • Tracking Customers and Their Orders
  • Increasing Sales with Marketing

Sitecore® Experience Commerce™ 9 200: Essentials

  • Gaining an Insight into the Sitecore® Experience Commerce™ Architecture
  • Developing Storefronts Using Sitecore Commerce APIs
  • Developing Sitecore® Experience Commerce™ Storefront Pages Using SXA
  • Working with Sellable Items
  • etc…

Sitecore Experience Commerce 9.0 300: Developer

Please review the course modules here https://www.konabos.com/blog/sitecore-experience-commerce-9-0-developers-300-training-in-powerful-ways/ – this includes:

  • Create & configure a new Storefront Site
  • Creating a Site Page Framework – you go through how you create the header and footer components and assign those to a page layout for all the page.
  • Creating pages for the Storefront for displaying sellable items like category pages and product pages.
  • Creating account management pages for registration, login, my account page, addresses page, etc.
  • Creating the order flow pages for cart, billing, shipping, payment and confirmation.

I also like to thank my Company Valtech for providing me the code for 100 and 200 level courses, much appreciated.

I would suggest to go for this and check with you company if they can provide you the code for these course and if yes? what you are waiting for? let’s do it.

How to Register?

Login to https://elearning.sitecore.net and search for Experience commerce 100/200 courses, if you don’t have any account, please create one.

So far it’s been great- looking forward for it.

XC-100XC-200

Happy Learning 🙂

https://www.konabos.com/blog/category/sitecore-commerce/

https://elearning.sitecore.net