Quantcast
Channel: Sitecore basics!
Viewing all 178 articles
Browse latest View live

Decade’s worth of 11 Sitecore modules

$
0
0

Challenge:

Last week Robert Hock published new UI for my Cache tuner module. Which looks great! This module got lot of buzz in Sitecore community last week, and I was surprised to know that lot of folks were either not aware of this tool (Which is published since 27-April-2011 : https://sitecorebasics.wordpress.com/2011/04/27/cache-tuner-user-guide/) or used it in the past. But forgot about it.

As Rob mentioned in the post, At times we used some module. But we forget about it (At times, I also come across my modules from Google or talking to others and same happens for my blog posts as well 😉 – But that’s why I blog – So, as you?!)

In this blog post, Thought to list down all my modules and their usage and link to download for you! [And for me as well ;)]

Sounds great?! – Let’s delve into it

Solution:

List of modules are as below:

  1. Cache Tuner : Cache Tuner Module helps you to understand your Sitecore Caching usage and helps you for fine tuning cache sizes as per Sitecore’s Caching Guide Recommendation. It has two versions Pre Sitecore 8.X and after that [as Sitecore 8.2ish had major caching updates]
    1. https://marketplace.sitecore.net/Modules/C/Cache_Tuner.aspx?sc_lang=en
    2. https://sitecorebasics.wordpress.com/2011/04/27/cache-tuner-user-guide/
    3. V2 : https://sitecorebasics.wordpress.com/2019/06/10/cache-tuner-v2/
    4. https://github.com/klpatil/CacheTuner
  2. Hot Fix Checker : It will list all packages installed in your Sitecore Instance. It will also help you to answer questions related to packages installation like Who created package?, Who Installed it?, When it got installed?
    1. https://github.com/klpatil/HotFixChecker
    2. https://sitecorebasics.wordpress.com/2019/09/27/module-hotfix-checker-hfc/
  3. Advanced Stats Page : This tool allows users to visualize Sitecore rendering stats data in an intuitive and simplified way. Which will help you to identify slow renderings, fix them and have happy end users!
    1. http://klpatil.github.io/Advanced-Stats-Page/
    2. https://marketplace.sitecore.net/en/Modules/A/Advanced_Stats_Page.aspx
  4. Item Utility : Sitecore Item Utility to do bulk operations
    1. https://github.com/klpatil/SCItemUtil
    2. https://sitecorebasics.wordpress.com/2017/08/30/sitecore-item-utility/
  5. Quick Item Search : This module is upgraded version of http://trac.sitecore.net/QuickItemSearch module which works on Sitecore 5.1. But this module will work on all Sitecore 6.X versions [I’ve tested with Sitecore 6.4/6.5].
    1. https://sitecorebasics.wordpress.com/2011/06/01/quick-item-search-user-guide/
    2. https://marketplace.sitecore.net/en/Modules/Q/Quick_Item_Search.aspx
  6. Package History : It will list all packages installed in your Sitecore Instance. It will also help you to answer questions related to packages installation like Who created package?, Who Installed it?, When it got installed? V2 : Package History V2 has been launched. In which we provided a functionality using which you can uninstall Sitecore Package/Module just by few clicks!
    1. https://github.com/klpatil/PackageHistory
    2. https://sitecorebasics.wordpress.com/2014/02/10/package-history-v2-user-guide/
    3. https://marketplace.sitecore.net/en/Modules/P/PackageHistory.aspx
  7. Sitecore History Viewer : This Tool allows users to view,search,sort Sitecore Databases History
    1. https://github.com/klpatil/HistoryViewer
    2. https://marketplace.sitecore.net/en/Modules/S/Sitecore_History_Viewer.aspx
    3. http://klpatil.github.io/HistoryViewer/
  8. Sitecore Audit Trail : This Tool allows users to see Sitecore Audit Trail — Who did What changes and When?
    1. https://marketplace.sitecore.net/en/Modules/S/Sitecore_Audit_Trail.aspx
    2. https://github.com/klpatil/Sitecore-Audit-Trail
    3. http://klpatil.github.io/Sitecore-Audit-Trail/
  9. SC Log Explorer : The SC Log Explorer tool will give you an easier overview of the Sitecore log files when you need to analyze them. 
    1. https://sitecorebasics.wordpress.com/2012/06/07/sclogexplorer-user-guide/
    2. https://marketplace.sitecore.net/en/Modules/S/SC_Log_Explorer.aspx
  10. Mongo Shell : Sitecore tool to query SQL Data
    1. https://klpatil.github.io/SC-82-Demo/
    2. https://github.com/klpatil/SC-82-Demo
    3. https://marketplace.sitecore.net/en/Modules/M/Mongo_Shelll.aspx
  11. SitecoreBasics.Extensions : Sitecore Extension methods source code, docs and package
    1. https://github.com/klpatil/SitecoreBasics.Extensions
    2. https://sitecorebasics.wordpress.com/2012/07/26/sitecore-extension-methods/

Apart from this, I also contributed to following open source module:

Wow! — 11 Modules in my 10 years of Sitecore experience! To be honest, I had also forgot about few of my modules and this post refreshed my memory. I hope you find this post as helpful as I found it!


SearchStax with Sitecore Azure PaaS

$
0
0

Challenge:

Sometime back, we were trying to integrate SearchStax with Sitecore 91 PaaS environment.

I got some good documentation to begin with. But it took me sometime to accomplish my goal. With the help of SearchStax team [They are great!] was able to achieve my goal.

Recently came across similar question by someone in Sitecore Slack group. So, thought to blog it here.

Solution:

This post assumes, that you are already aware about SearchStax – Basics and how to get started, Solr, SolrCloud basics.

As you do, I also did quick search and came across following great posts!

Initial posts clarified lot of my basic fundamentals, Last post : https://www.searchstax.com/docs/sitecore-9-1-solr/ is really good. But If you are trying to do it for your Sitecore Azure PaaS environment. You need to alter some steps and I also faced some errors. Let me outline that for you:

  • You no need to do Step#1.
  • Do Step#2.
  • Step#3 : SearchStax team has created nice plugin, which helps you create all initial required collections — Basically, Plugin abstracts zookeeper config upload steps:
    • Instead of using searchstax-sitecore-plugin-1.0 use 1.1. As we found bug in 1.0. Use 1.1 from here : https://github.com/searchstax/searchstax-sitecore-plugin/releases or direct link https://github.com/searchstax/searchstax-sitecore-plugin/releases/tag/v1.1
    • Script relies on PowerShell core. To start PowerShell Core – you need to type pwsh.exe in CMD/Powershell – See this video : https://www.youtube.com/watch?v=UGCMbYAufp0
    • Extract downloaded plugin and update YML file as per given instruction. [pathToWWWRoot : Is not important in Azure PaaS. But still you have to provide it and sitecorePrefix (Will be used to prefix your Solr collection/cores.) also should be valid site. Plugin will update config files. So, you might need to take backup of local file – ConnectionStrings.Config]
    • Run this from CMD/Powershell. Make sure you are in PowerShell Core. It will also ask your SearchStax credentials. So, please keep them handy!
  • Once above step is done, your Solr collections are ready. You can access Solr Admin screen to confirm that (You should see 11 collections). It also updates Solr Connection string in your local. Please revert those changes to your local Solr instance. [We took backup in earlier step]

Note : It doesn’t create XDB Core. https://doc.sitecore.com/developers/90/platform-administration-and-architecture/en/walkthrough–using-solrcloud-for-xconnect-search.html#UUID-00ee25a3-647f-aa18-6f98-805fa4f305de_section-5c3ef326406c3-idm45266705934112– As of now you have to create manually or update scripts to do that.

  • Till this point of time we have setup our Solr Cloud instance. Now. let’s connect it with our Sitecore Instance.
  • Once all above steps are done, Login to your Sitecore instance and from Control Panel – Do “Populate Schema from the Control Panel in Sitecore” step.

This post depicts steps with Sitecore 9.1. But I believe it should work with 9.2 https://www.searchstax.com/docs/sitecore-9-2-solr/ as well. I’m not sure Search Stax Plugin issue is fixed in 9.2 document or not. Also, I heard Search Stax is coming up with Sitecore LaunchPad Plugin (https://sitecorebasics.wordpress.com/2019/11/30/searchstax-with-sitecore-paas/) to simplify these steps. I’m sure you must be excited to try this. So, as I!

Hope you found this post helpful – Big Shout out to SearchStax team for coming up with such a great solution.

Image Credits : SearchStax

200th Sitecore Blog Post

$
0
0

I’ve been sharing my Sitecore basics via this blog since 2011. Today, I’m super happy and surprised that, I’m writing my 200th blog post. (Double century is really special – You can understand that I’m coming from Cricket playing nation 🙂 )

This would have not been possible without following people:

  • All those great souls who inspired me to write!
  • Great souls like you who kept reading my blog and appreciate what I did – Which motivated me to keep going. As starting Sitecore or any blog is easy. But to keep it going needs more efforts. Would have used this time doing something else. But I feel grateful that I invested my time on this blog which helped lot of Sitecore Souls across the globe!

Some Stats:

This post will make posts count to 200
All time views
Annual Site stats
Total followers
This is my favorite – Could contribute on larger part of the earth in some way!

Summary:

  • Total posts : 200
  • Total views : 519518
  • Total visitors : 254007
  • Total words : 107450

Perfect day [Thanksgiving] to write this blog. I’m Thankful for:

  • Those who taught me Programming
  • Those who taught me Sitecore
  • Those who inspired me to blog
  • Those who read my blog and kept me going

Hope this post inspires you to start your blog or restart your blog which you haven’t updated since quite some time.

Happy blogging! 🙂 – Start your blog, might not for others. But for your self! [At times, I find solution from my old post 😉 ]

RedisTimeoutException with Sitecore 9.0.2 – 9.3

$
0
0

Challenge:

In recent time, was involved in Sitecore 9 Azure PaaS Implementation for few of our enterprise clients, who had humongous amount of data, traffic and multi-region CD servers to handle load.

We faced RedisTimeout challenges during 9.0.2 launch and recently we faced similar challenges for 9.3 upgrade. It was moderate for later than earlier. But in both case, we spent good amount of time and we have learnt something new. So, thought to share with you. So, hopefully it can reduce your resolution time.

So, If you are also haunted with RedisTimeout exceptions and your launch is due soon and looking for some solutions this post might help you.

Solution:

I won’t spend much time explaining basic details about it. But I would strongly recommend you to read following great posts:

If you’ve already been through above posts, Great! Please keep reading.

Before we talk about Solution, Let’s talk about Why this happens?

If you want to know more about Session and how it works, I would strongly recommend you to read this great post : https://mhwelander.net/2016/05/19/lets-talk-about-session-state/

By this time, your basic understanding should be clear. In XP Scaled and Multi-region most applications will prefer to use Out-Proc session for obvious reasons explained in the post earlier.

So, if you are expecting lot of traffic then your CD Servers should have enough power to handle session threads as well as your REDIS server should also be powerful enough to handle those session requests.

When you are troubleshooting REDISTimeout issues, find your bottleneck first. Here are few of our learnings to identify bottleneck:

  1. Check CPU Usage of CD Server – It is high? :Then your CD server needs more power (Just a note : If your CD’s CPU is high, then there might be another reasons for that. Which needs to be checked. But for simplicity of this post, We are assuming all other issues are already taken care). Give a tier upgrade and check again.
  2. If you are not noticing high CPU on CD and REDIS is overloaded then good to add more power to your REDIS app.
  3. If you’ve upgraded them to both of them to higher tier and if you are still noticing REDIS errors then you should apply configurations given in KB Article and mentioned below – Please keep reading this post.

Can you show me some more symptoms?

If you are not sure you are impacted by REDISTimeout exceptions or not following are few symptoms of it:

AI Logs


Sitecore Logs


Azure tools (Latest) query “- traces | where timestamp > now(-1d) | where message contains “Exception” or customDimensions.StackTrace contains “Exception” | where customDimnsions.Role == “CD” | sort by timestamp desc | limit 100″
Dump file analysis

I’ve faced this error on multiple versions and solution for each version had slightly different. So, will divide solution in two parts:

In either of the version, you must need to refer this KB Article : https://kb.sitecore.net/articles/464570 – Please don’t get overwhelmed with information it provides, take few deep breaths and read – It’s good info. I personally feel Solution steps are not as straight forward as it should have been. But we all are learning together 🙂

  • Sitecore 9.0.2 : We noticed lot of performance challenges and during troubleshooting we found that our applications were setup (~2 years ago) as per Sitecore’s old tiers recommendation, And it was not capable to handle load. also, we had to upgrade our Redis Tier to C2 (C1 might work, if your site is not having heavy load)
    • We did some load testing and performance tuning and we learnt that upgrading CD apps to P2V2 (Do some performance test to find out right tier P1V2 might be a good one to go with. Also, good to move away from Standard tiers to Premium tiers as they are available at same price with better hardware! – Please refer this : https://azure.microsoft.com/en-us/updates/announcing-pricing-decrease-for-azure-app-service-on-the-premium-plan/)
    • We also had to upgrade our REDIS Apps to C2 (If you got moderate load than C1 might work for you!)
    • Apart from this we applied steps mentioned in KB Article : https://kb.sitecore.net/articles/464570#Solution(XP8.0-9.0)
      • Apply Step#1-3
      • But please make sure you read Notes section first. Whatever values you applied as per this KB article is just for reference, and you need to do some load testing before finding optimal value for your needs.
      • I’ve created gist with our configurations : https://gist.github.com/klpatil/9c19fe6f0b8c3cfa8e9ed76629e16c79
      • Please play close attention to following values in gist, we updated them for better results:
        • pollingInterval : Specifies the time interval in seconds that the session state provider uses to check if any sessions have expired. The default value is: 2.
        • executionTimeout
        • timeoutBetweenLockAttempts
        • Sitecore.Support.210408.config – Especially values given in this file needs close attention.
  • Sitecore 9.3 : As we had learnings from our last project (9.0.2) project we were not expecting any Redis error. But life is not as easy it seems to be :-). We again got haunted by REDISTimeout exceptions during our Performance testing period. Here’s what we learnt.
    • We were facing one odd error during UAT period. But during load testing. We noticed that REDIS errors count went high. And that’s when we started to investigate further on this before go-live:
    • Tiers : Luckily, we haven’t faced much challenges with tiers. CD servers were good. We only had to upgrade REDIS from C1 to C2 to handle load.
    • Sitecore Patch as per KB Article: As you must have noticed on this article it says – Fixed in 9.2. And if you scroll further it has suggested some steps : https://kb.sitecore.net/articles/464570#Solution(XP9.2InitialReleaseOrLater) and steps are also not super clear. Feeling same? We also felt same, And thought to reach out after couple of back and forth. Sitecore support also accepted that those steps need some work for 9.3 and here are our learnings till Sitecore updates KB article:
      • Good part is – you no need to apply and DLL patch for this.
      • Just some configuration updates as listed in this gist: https://gist.github.com/klpatil/0b395c5cf46a8ff5f04118ea49f05546
      • Biggest learning was maxConcurrencyLevel value should not be changed at all. As per 9.3 logic, if this value is not provided then 9.3 handles it in conjunction with batch size, else size you provided in config. And as per our learning default logic is optimal.
    • Load testing : Above steps reduced REDIS Timeout exceptions drastically. But whenever client used to run JMeter load test, they noticed REDISTimeout exception. After some consultation with Sitecore support and analysis we learnt that load testing script was sending unrealistic traffic and it was also not handling cookies properly.
  • You are still facing error? : If you are facing error even after following steps given above, then it might be good idea to create memory dump using procdump and try to analyze this with help of Sitecore support.
D:\hone\site\wwwroot\App_Data\dumps>D:\devtools\sysinternals\procdump -accepteula -e 1 -f "StackExchange.Redis.RedisTimeoutExceptio 
" -ma 285441
D:\devtools\sysinternals\procdump -accepteula -e 1 -f “StackExchange.Redis.RedisTimeoutException ” -ma <PID>

Both our environments are serving live traffic and we are having stable systems with No REDIS Timeout exceptions!

Hope this post helps you to fix you REDIS timeout exceptions or avoid them before you see them. Special thanks to Sitecore support team and my colleagues Joseph and Khushboo for all their help during troubleshooting!

Broken AzureTools.aspx on Sitecore 9.3

$
0
0

Challenge:

If your Sitecore app is on Azure and you are overwhelmed with Application Insights and need simple tool to check logs. AzureTools.aspx is an answer for that. You can find more about it from here: https://kb.sitecore.net/articles/911837

I’ve been big fan of this tool and Sitecore has been updating it regularly – https://sitecore.app.box.com/s/5f57l7fxk2zujriizzzs500k4qw91oyd

Recently I was trying to use it on my local 9.3 instance, but it was not working. When I deployed same aspx page on 9.0.2 solution it worked.

I spent lot of my time troubleshooting and finally was able to figure out. If you are facing similar issue or going to give a go to this tool soon. Then this post is for you only!

Solution:

Sitecore 9.3 OOTB comes with strict CSP rules. Read more here : https://kb.sitecore.net/articles/464569

Which is good and must be there for security reasons. But in local environment it might can block few of your developer tools.

Here’s what I did to fix my error:

  1. Opened Webroot\Web.Config
  2. Did – Find and comment this node – <add name=”Content-Security-Policy”
  3. AzureTools.aspx was up and running!

As I was focusing on analyzing and fixing my other issues and it was my Dev environment. Commenting this node was an okay solution. But I strongly recommend that you should it enabled and try to tweak your policy to fix URL specific issues or revert your changes once your Log analysis is done. Will dot it someday, or if you do it please blog.

Good reads:

Sitecore redirect strategy

$
0
0

Challenge:

SEO is critical for any website and it becomes critical to have redirect strategy for migration projects. We have been involved in lot of migration projects. Where clients either migrate from their legacy platform to Sitecore with new URLs or from old Sitecore platform to new Sitecore platform with new UX and design.

Defining redirect strategy has been key factor in success of these migration projects. Now, with each Sitecore version and variant. There are lot options available. You might get confused which strategy should be implemented.

We learnt something during my recent migration project and thought to share those with you.

Solution:

Thought to create flow diagram, which can help you understand this easily:

I won’t try explaining each step, as it should be self-explanatory. If not, feel free to comment on this post. And will try to get an answer for you.

In this post, For your ease. Will provide links to few of the modules/approaches listed above:

  1. Good post : https://blog.baslijten.com/another-look-at-url-redirects-in-sitecore/
  2. Marketplace modules:
    1. Url Rewrite Module by Andy Cohen : Few good posts already discussed about this topic
      1. http://avillenas.com/post/url-rewrite-module-for-sitecore
      2. https://horizontal.blog/2016/09/08/sitecore-url-rewrite-backreferences/
      3. https://sitecoreart.martinrayenglish.com/2016/12/implementing-3000-redirects-in-sitecore.html
    2. Few other options : https://marketplace.sitecore.net/SearchResults#qr=Redirect
  3. IIS Url Rewrite : The Microsoft URL Rewrite module is an ISS extension that allows you to rewrite one URL to another using regular expressions.
    1. https://briancaos.wordpress.com/2014/04/25/url-rewrite-and-sitecore/
  4. SXA Redirect OOTB support :
    1. https://doc.sitecore.com/users/sxa/93/sitecore-experience-accelerator/en/redirect-a-url.html : Basic redirect
    2. https://doc.sitecore.com/users/sxa/93/sitecore-experience-accelerator/en/map-a-url-redirect.html : Advanced redirect

Hope you have smooth migration!

Sitecore Experience Accelerator (SXA) Basics

$
0
0

Challenge:

Howdy Friends, I’m really excited to share my first SXA post with you!

SXA 1.0 was launched in 2016 and SXA 9.3 (Yes, Sitecore has changed SXA versioning!) has been released on November 2019.

I just explored little bit when it was launched, But I had my own apprehensions about It’s adoption due to unclear Sitecore licensing process [at-least to me] and lot of other things. But as following quote says:

All change is hard at first, messy in the middle, and so gorgeous at the end.” – Robin Sharma.

I think this is true for SXA as well. SXA 9.3 is gorgeous version! [That doesn’t mean past version has been hard/messy 😉 ]

I wanted to learn SXA, But there were lot of resources on the web posted by great people. As a newbie, I was confused. From where to start? [You as well!?]

Image result for confused kid with options
Image Credits : https://www.successunlimited-mantra.com/index.php/blog/what-to-do-when-confused

Or, If you have following questions in your mind, then this post is for you!

  • Where to learn SXA basics?
  • What is SXA?
  • Why I should learn and adopt SXA?
  • How can I be expert in SXA?
  • What is co-relation between Sitecore Custom, Sitecore SXA, and Sitecore JSS? Are they competing development methodologies or complementing each other?
  • We are starting new project — It should be on SXA or Custom?
  • How SXA development is different than my earlier Sitecore Custom Development (Sitecore WebForms/MVC Development)?
  • I’m working on Sitecore since long time, So, whatever I’ve learnt on Sitecore platform till this point of time will be of no use?
  • Our FED-BED integration process will be impacted by SXA?
  • All my FED team need to learn SXA?
  • All my FED team need to have Sitecore instance in local?
  • BED Developer Can’t I work ahead of FED Developers?

Wow, There are lot of questions. I might not be able to cover all of them in this post. But I will try to share SXA fundamentals and try to answer few questions and by end of this post my goal will be that you will be self sufficient to find your own answers!

Quotable Quote:

Give a man a fish and you feed him for a day. Teach him how to fish and you feed him for a lifetime

Solution:

Let’s follow the W-W-H (What, Why, How) learning framework for SXA.

What is SXA?

Let’s refer Sitecore’s definition : https://doc.sitecore.com/users/sxa/93/sitecore-experience-accelerator/en/introducing-sitecore-experience-accelerator.html

Web development teams use Sitecore Experience Accelerator (SXA) to speed up the production of websites and to reuse components, layouts, and templates across a variety of sites.

SXA separates structure from design, so front-end designers, creative designers, content authors, and developers can work in parallel and you can deploy and maintain multiple sites quickly and cost effectively. Once a basic user experience plan is in place, everyone can get started on the platform. For example: the content author can start entering the content in the wireframe environment, while the front-end developer works on the theme, and the developer sets up the data templates.

Before we go in further details about SXA. Let’s understand type of Sitecore Development:

Image credits : http://www.pieterbrinkman.com/2019/12/02/sitecore-9-3-whats-new-blog-series/
  • Custom : If you have been doing Sitecore Development since long time, then you must have seen Sitecore framework ivolved from XSLT [You are getting old? :-)], to Web Forms and MVC. We’ve taken a big leap in development from XSLT to MVC for sure. But as a human we always want to do better than yesterday. Sitecore industry folks also wanted to make product better for the full eco system. Developers across different companies/projects/agencies have been spending more time on building those similar components – Header, Footer, Menu etc. rather than focusing on core business challenges and this was impacting “Time to market” for business. Everyone was looking for something better and there were few accelerators built by few companies for either their in-house use or as a product. But Configide‘s Zengarden was promising. It got adopted by lot of companies and community members. Sitecore also noticed that and adopted SXA in Sitecore’s offerings!
  • SXA : SXA stands for Sitecore Experience Accelerator. As name suggests, it helps you to speed up your website development. SXA comes with over fifty components that can be completely customized for the needs of your brand.
  • Sitecore JSS : For headless development.

Refer following diagram which depicts SXA benefits :

SxA Website development process 
User Experience 
Visual Design 
Frontend Development 
Backend Development 
Content Entry 
Time to market

Let’s try to understand above diagram with an example – Company Contoso Inc. acquired new brand and would like to spin up a new website. They asked two different teams to develop website using different approaches. Sitecore Custom vs Sitecore SXA.

This is how overall process looks like:

Sitecore custom approach – Looks more like old manufacturing assembly approach. Where each department can work on module, once last department completes their work.
SXA approach – Looks more like round-table approach. Where everyone can work collaborate together!

As you rightly guessed, SXA team could spin up new website faster than Custom Development team.

ALERT! — If your Maths is good and you are a business stakeholder, Then please don’t create formula that SXA site should take 5 times less than Custom Development approach. It might not work that way. As each Site has different features, integrations and complexity. Please let your implementation team come up with proposed solution and time it needs to build. You also need to consider some learning curve for this new tool set. But relatively SXA should take less time than Custom. But how much that all depends on lot of factors. Which your implementation team will be able to share with you.

Also, depends on your site’s complexity, you might need to divide some work between Design, FED and BED team.

If you want to read more about SXA, I strongly recommend you to read this doc : https://doc.sitecore.com/users/sxa/93/sitecore-experience-accelerator/en/introducing-sitecore-experience-accelerator.html

As you might have noticed from architecture diagram. Lot of other Sitecore pieces are old e.g. MVC, WFFM, Presentation etc. You must have noticed Sitecore Powershell module in architecture diagram.

Powershell module is heart of SXA.

Why SXA?

I believe by this time you might have already been clear with “Why SXA?” and you must be saying “Why not SXA?” 🙂 But still if you are someone who needs more reasons before deciding. I would recommend you to read following posts:

If you reached thus far and have heard following feedback from your colleagues/friends about SXA and hesitant to use SXA with that feedback or not:

  • Front-end and Back-end integration is challenging.
  • It’s cumbersome to make rendering variants.
  • Front-end markups can’t be exactly applied in Back-end.
  • Export and Import process of Creative exchange is cumbersome when project is complex and team is big.
  • It’s good for small sites. But if Site has complex custom design. Then customization takes lot of time.

This all is great feedback and learnings. Sitecore product team have been listening and working on it, and came up with SXA 9.3 version. Which has major updates. Two of my favorites are:

  • Scriban templates support – This is huge and solves two main challenges – FED-BED integration and makes customization super simple and extensible!
  • Front-end and Back-end integration workflow has been revamped : Raw FED Assets has been moved to file system rather than media library. So, your FED team mates can work in isolation and larger team can work together. Only compiled assets will be stored in Sitecore media library.

I will not spend much time writing about SXA 9.3 as lot of great souls have already written/shared about it:

What!? You are still not convinced to use SXA and need to see more reasons to use SXA over Custom Development?

Let me share few examples using which you can compare Custom and SXA way to do things and understand how efficient SXA is:

  1. SXA Caching Options : Read this section : https://doc.sitecore.com/developers/sxa/93/sitecore-experience-accelerator/en/set-sxa-caching-options.html – Allows you to apply HTML Caching at Site, Component, Placeholder level along with donut caching.
  2. Source field report OOTB : https://doc.sitecore.com/developers/sxa/93/sitecore-experience-accelerator/en/run-a-source-field-report-to-set-the-data-source-context.html
  3. Helps you choose option : https://doc.sitecore.com/developers/sxa/93/sitecore-experience-accelerator/en/flowchart-to-determine-whether-to-create-a-custom-rendering.html
  4. Easy cloning : https://doc.sitecore.com/developers/sxa/93/sitecore-experience-accelerator/en/clone-an-sxa-site.html – You can create pattern library and clone it as per your need.
  5. SXA Site manager : https://doc.sitecore.com/developers/sxa/93/sitecore-experience-accelerator/en/manage-multiple-sites-with-the-sxa-site-manager.html – No more restarts for adding/deleting website!
  6. Standard Security and roles management : https://doc.sitecore.com/developers/sxa/93/sitecore-experience-accelerator/en/security.html

Hopefully you must have been convinced to use SXA by this time. If not, then please drop your use case and we can try to understand more about it :-). It might be possible that custom development might be more efficient for you to use than SXA.

Please remember technology and tools can’t solve all problems!

How to use SXA?

If you reached thus far. Then it means you are all charged up to learn SXA and looking for sources from where you can start learning basics of SXA.

I will share my learning sources and approach which I followed. Feel free to tweak it as per your need.

  1. Sitecore e-learning courses : I was very impressed with Sitecore training course’s new design. If you are developer, you might not find lot of value from Development Point of view. But these courses are great to have SXA’s fundamental understanding. You can follow your suitable approach to learn SXA. I learnt following two courses:
    1. Introduction to Sitecore® Experience Accelerator 9
    2. Fast-Track Design in Sitecore® Experience Accelerator 9
  2. Short, unofficial, ad-hoc, Sitecore SXA tutorials : This is second great source to learn SXA. Lot of great videos have been posted here. But please don’t get overwhelmed with all videos. To learn SXA, you no need to go through all videos. To keep things simple, go through some basic videos – especially – How to create site, Page Design, Partial design, Rendering variants etc. : https://www.youtube.com/channel/UCn_P819AlbNv_maQCqrKp4g/videos
  3. Sitecore Documentation : https://doc.sitecore.com/developers/sxa/93/sitecore-experience-accelerator/en/setting-up-and-configuring.html – This is another great source to learn more about SXA features. I would really like to shout-out documentation team for doing great job in documenting SXA as well as some of the recent document updates have been really great! – Looks like, Sitecore documentation team is going in right direction.
  4. Practice, Practice, Practice : Nothing can beat this step. You must need to do hands-on with SXA concepts. As there are lot of concepts to explore and you can’t remember those, until you practice.
    1. Install SXA : If you are using Sitecore Install Assistant then installing SXA is super easy.
    2. Create one website : Create one simple website, which has header, footer and some pages.
    3. Create new theme using SXA CLI and try to create few rendering variants with or without Scriban
    4. If you have been working with Sitecore Custom Development since long time, and have been aware about some best practices like Standard values, Renderings, Layouts etc. try to understand their Sitecore SXA approaches.
  5. Advanced learnings:
    1. https://buoctrenmay.com/2019/12/23/sitecore-xp-9-3-0-and-sxa-9-3-0-demo-habitat-home-setup-guide/
    2. Build complex website using SXA 9.3 and Scriban templates.

Hope you found this post helpful, and will help you to quick start your SXA learning. If you learn something new please blog and share with everyone!

Have a happy site building experience! 🙂

Good reads:

Image credits:

SXA Renderings Cheat Sheet

$
0
0

Challenge:

Recently have been doing SXA GAP analysis for new project. Sitecore documentation team has done great job documenting those here : https://doc.sitecore.com/users/sxa/93/sitecore-experience-accelerator/en/the-sxa-renderings-and-rendering-variants.html

As you can see there are 70+ components and it’s easy to remember all of them (you no need to in real world). But when you are doing quick analysis and try to map Non SXA component with SXA.

Mark and SXA team has done great job help you visualize all components using this SXA Style guide : https://www.markvanaalst.com/blog/sxa-styleguide/introducing-the-sxa-styleguide/ (Thank you so much!)

Still I wanted to have list of all components as a single reference card. So, I can quickly review it. And that’s how idea of having SXA Renderings Cheat Sheet came into existence!

Solution:

You can view/Download PDF from here : https://cheatography.com/kpatil/cheat-sheets/sxa-renderings/

  1. First column indicates Rendering name
  2. Second column indicates whether it supports rendering variant or not (If this column doesn’t exist means it doesn’t support rendering variant)
  3. Third column indicates Description

Happy SXA Development! 🙂


TDS update package errors with Sitecore 9.3

$
0
0

Challenge

Recently worked on couple of Sitecore upgrade projects, where we used TDS’s update package feature in release mode. So, we can automate package installation process using CI/CD tools.

This feature, Just works! But recently we faced two challenges which I would like to share with you. In case, you are also facing the same.

Solution

Some Basics:

Before we talk about specific errors and solutions. Would like to share with you about how Package generation works? [If you already know about this, feel free to skip this section and move to next section]

  1. I strongly recommend you to read this : https://www.hhogdev.com/help/tds/proppackaging
  2. For this feature to work – You’ve to ensure that you’ve following configurations:

Above list will work for < Sitecore 9.X version. But you need to have few additional DLLs for your Sitecore 9.X+ version.

  • Sitecore.Kernel
  • Sitecore.Update
  • Sitecore.Log
  • Sitecore.Zip
  • Microsoft.Extensions.DependencyInjection.Abstractions
  • Microsoft.Extensions.Logging.Abstractions
  • “The package builder failed. Please set the build logging level to Normal or Detailed and see the build output log for more information on the failure.”

We got above error when we were trying to use TDS package generation feature with TDS Version 6.0.0.12 and Sitecore 9.3:

As you can see above error, doesn’t provide much information about the exact error. We enabled detailed logging as explained in this post : https://sitecorebasics.wordpress.com/2017/03/02/tds-error-while-generating-update-package/

After doing above configurations, we could find following entry from log :

Looking for Sitecore assemblies in C:\projects\SCBasics\SC-New\Sitecore\packages
Found assembly C:\projects\SCBasics\SC-New\Sitecore\packages\Sitecore.Kernel.9.3.0\lib\net471\Sitecore.Kernel.dll
Found assembly C:\projects\SCBasics\SC-New\Sitecore\packages\Sitecore.Logging.9.3.0\lib\net471\Sitecore.Logging.dll
Found assembly C:\projects\SCBasics\SC-New\Sitecore\packages\Sitecore.Update.9.3.0\lib\net471\Sitecore.Update.dll
Found assembly C:\projects\SCBasics\SC-New\Sitecore\packages\Sitecore.Zip.9.3.0\lib\net471\Sitecore.Zip.dll
Found assembly C:\projects\SCBasics\SC-New\Sitecore\packages\Microsoft.Extensions.DependencyInjection.2.1.1\lib\net461\Microsoft.Extensions.DependencyInjection.dll
Found assembly C:\projects\SCBasics\SC-New\Sitecore\packages\Microsoft.Extensions.DependencyInjection.2.1.1\lib\netcoreapp2.0\Microsoft.Extensions.DependencyInjection.dll
Found assembly C:\projects\SCBasics\SC-New\Sitecore\packages\Microsoft.Extensions.DependencyInjection.2.1.1\lib\netstandard2.0\Microsoft.Extensions.DependencyInjection.dll
Found assembly C:\projects\SCBasics\SC-New\Sitecore\packages\Microsoft.Extensions.DependencyInjection.Abstractions.2.1.1\lib\netstandard2.0\Microsoft.Extensions.DependencyInjection.Abstractions.dll
Exception Could not load file or assembly ‘Microsoft.Extensions.Logging, Version=2.1.1.0, Culture=neutral, PublicKeyToken=adb9793829ddae60’ or one of its dependencies. The system cannot find the file specified.(System.IO.FileNotFoundException):
at Sitecore.DependencyInjection.DefaultSitecoreServicesConfigurator.Configure(IServiceCollection serviceCollection)
at Sitecore.DependencyInjection.BaseServicesConfiguratorFactory.Configure(IServiceCollection serviceCollection)
at Sitecore.DependencyInjection.BaseServiceProviderBuilder.ConfigureServiceCollection()
at Sitecore.DependencyInjection.ServiceLocator.ConfigureServiceProvider()
at Sitecore.DependencyInjection.ServiceLocator.get_ServiceProvider()
at Sitecore.Configuration.Settings.<>c.<.cctor>b__351_0()
at System.Lazy1.CreateValue() at System.Lazy1.LazyInitValue()
at Sitecore.Update.Update.Serialization.SerializerFactory.GetSerializationType()
at Sitecore.Update.Update.Serialization.SerializerFactory.GetSerializer()
at HedgehogDevelopment.SitecoreProject.PackageBuilder.PackageBuilder.GetSitecoreItemCommands(List1 cmds, BuildContext ctx, String projectFileFolder, Project sourceTDSProject, HashSet1 includedItems)
at HedgehogDevelopment.SitecoreProject.PackageBuilder.PackageBuilder.BuildPackage(BuildContext ctx)
at HedgehogDevelopment.SitecoreProject.PackageBuilder.Program.Main(String[] args)
C:\projects\SCBasics\SC-New\Sitecore\packages\HedgehogDevelopment.TDS.6.0.0.12\build\HedgehogDevelopment.TDS.targets(180,5): error : The package builder failed. Please set the build logging level to Normal or Detailed and see the build output log for more information on the failure.

We reached out to TDS Support team and they gave us new nuget package, which helped us resolve the issue. If you are starting your new project. I recommend you to use latest TDS version. This issue has been fixed in TDS 6.0.0.13

  • “Exception Could not load file or assembly ‘System.Runtime, Version=4.2.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a’ or one of its dependencies. The system cannot find the file specified.(System.IO.FileNotFoundException):”

We got above error with TDS.6.0.0.14 with Sitecore 9.3

We reached out to TDS Support and this is what they replied:

This is likely caused by mixing the assemblies from .net core and standard in your package references. TDS doesn’t know which assemblies to use. The simplest way out of this is to create a folder relative to the solution root that contains just the assemblies needed by packaging and point the “Sitecore Assembly Path” value at that folder.
Please make sure to put the specific versions of the assemblies into that folder that are distributed with Sitecore. The best thing to do is to get them from the /bin folder in the Sitecore distribution. The assemblies you will likely need are:

Sitecore.Kernel
Sitecore.Update
Sitecore.Log
Sitecore.Zip
Microsoft.Extensions.DependencyInjection.Abstractions
Microsoft.Extensions.Logging.Abstractions

If you need more than this, the update package step will warn you and you can get them from the /bin folder.

After correcting our nuget references to use standard package reference and NOT .net core helped us fix the issue, Apart from that we also had to make sure that we use 2.1.1 version of Microsoft.Extensions.Options nuget package.

That’s it, Happy TDS Deployment! 🙂

7 learnings from Sitecore 9.3 upgrade

$
0
0

Challenge:

Recently we have done a couple of Sitecore 9.3 upgrades and while doing that learned a few things which would like to share with you with a goal that it might make your upgrade journey smoother!

For both projects, we installed and configured Plain Sitecore 9.3 and ported over code/configurations and Sitecore items from old instance to newly setup 9.3 instance.

Solution:

#1 : Core DB error while accessing /sitecore/login on CD Server

As per Security best practice, /sitecore/login should not be accessible on CD Server. We got following error when we tried the same:

We reached out to Sitecore support and they gave us a link to KB article: https://kb.sitecore.net/articles/137194 as you might have noticed from KB article that this issue applies to 9.1+ version.

We tried KB article steps. But with no luck 😦

We had some back and forth with Sitecore and finally following steps worked for us, Which was approved by Sitecore support as well:

  1. Deployed modified patch file under App_Config\Include\z.Hotfix folder. (We had to keep shell site, which is required for EXM, as per error message)
<?xml version="1.0" encoding="utf-8"?>
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/"
xmlns:role="http://www.sitecore.net/xmlconfig/role/"
xmlns:security="http://www.sitecore.net/xmlconfig/security/">
  <sitecore role:require="ContentDelivery">
    <sites>
      <site name="login">
        <patch:delete />
      </site>
      <site name="modules_shell">
        <patch:delete />
      </site>
    </sites>
  </sitecore>
</configuration>

2. Added following node in CD’s Web.Config. (You can also add web.config transform for automatic deployment)

<location path="sitecore">
  <system.web>
    <authorization>
      <deny users="*"/>
    </authorization>
  </system.web>
</location>

#2 : Identified Content delivery users as editors

We’ve been using Federated Authentication (Azure AD B2C) for Content delivery users/visitors. As soon as 5+ users/visitors login from CD Server they were getting redirected to Users are getting redirected to : /sitecore/client/Applications/LicenseOptions/StartPage – Usually you hit this page on CM server. When the number of logged-in content author’s count has exceeded your allowed license limit

From log file, We came across following log entry

“7692 17:25:11 WARN The maximum number of simultaneously active (logged-in) editors exceeded. The User extranet\x9lg8FkakV cannot be logged in to the system. The maximum of editors allowed by license is 5.”

Came across this https://sitecore.stackexchange.com/questions/24276/why-content-delivery-in-sitecore-9-3-is-treating-users-as-editors As per this post – “Sitecore support has registered this a bug with reference number 366550, and there is (on request) a hotfix available for 9.3.”

We reached out to Sitecore support and they shared SC Hotfix 402431-1.update package with us. Deploying this patch fixed our issue!

#3 : Final step Workflow will not be listed in Workbox

This will be a super rare issue. But this was due to the client’s earlier setup and internal process, Where If an item reaches the final state. Someone will go to Workbox and manually publish. We were having parallel discussions and suggested a better approach. The client team wanted to have this functionality as-is. which works in Sitecore 8.2.

We reached out to Sitecore support and they were not able to find out when and why this got changed. But Sitecore support was able to help us with CustomWorkboxForm.cs file. Let me know if you also have a similar issue and I’ll share the file with you. I still believe this should be handled using Auto publish configuration.

#4 : Redis driver timeout issues

This KB Article: https://kb.sitecore.net/articles/464570#Solution(XP9.2InitialReleaseOrLater) indicates that the issue is fixed in CMS 9.2 Initial Release. Which is true from the code point of view. But you still need to tweak your REDIS configurations. I’ve already penned down my thoughts on this earlier : https://sitecorebasics.wordpress.com/2020/02/15/redistimeoutexception-with-sitecore-9-0-2-9-3/

#5 : CTRL + S shortcut does not work in Experience editor

We noticed that CTRL + S operation was not working in the experience editor. Sitecore support was able to reproduce this issue and registered it as Bug: 359703. There is a change in PageEditor.JS. If you don’t have any customization in your PageEditor.JS then you can follow the steps given below:

To resolve this issue, please uncomment the following from your “Website/sitecore/shell/Applications/Page Modes/PageEditor.js“:

 this.save = function(postaction) {
  var command = "webedit:save";
  if (postaction) {
    command += "(postaction=" + postaction + ")";
  }

  this.onSaving();
  this.postRequest(command, null, false);
};

 

if (e.keyCode == 83 && e.ctrlKey) {
  e.preventDefault();
  this.save();
  return;
}

#6 : SQL Exception when login to Sitecore

During login we faced following SQL Exception :

Nested Exception

    Exception: System.Data.DataException
    Message: Error executing SQL command:  
		INSERT INTO [Properties] (   [Key], [Value] ) VALUES (   @name, @value )

    Nested Exception

    Exception: System.Data.SqlClient.SqlException
    Message: String or binary data would be truncated.
    The statement has been terminated.
    Source: .Net SqlClient Data Provider

We were able to fix this issue by following steps given in this post : https://www.thomsip.net/articles/sql-exception-when-login-to-sitecore-9-1

But as per this KB Article: https://kb.sitecore.net/articles/615926 This issue is fixed when we asked more about this to Sitecore support. Here’s what they shared

I checked deeper and found out that it was because the texts: “SC_TICKET_” and “CORE_SC_TICKET”.
The KB mentions about “SC_TICKET” which is actually fixed (you could clarify that there is only CORE_SC_TICKET now but not SC_TICKET).Internally, Product team targets to fix this bug 223702 in the version 9.4. I have already informed Product team about this.

It looks like this issue is still open and If you come across this error then you can follow steps given in earlier post by Thom Sip.

#7 : Indexing error : sitecore- prefix is used for two Solr indexes

Core name for sitecore_testing_index and sitecore_suggested_test_index have “sitecore-” prefix. But other cores are using sitecore_ prefix.

To keep it consistent. We’ve created the following patch file to update Core names for those two indexes.

That’s it for now. As you can see we had a lot of learnings and it wasn’t done by me alone. Thanks to everyone who has been involved in these efforts!

If you have new learnings, It will be good to share it with the community. I’m looking forward to your learnings!

Sending an email using SendGrid with Sitecore

$
0
0

Challenge:

We’ve been using SendGrid for sending emails for most of our Azure PaaS clients. In case you are not aware of SendGrid. The following information will help you understand more. Source:

SendGrid is a cloud-based SMTP provider that allows you to send email without having to maintain email servers. SendGrid manages all of the technical details, from scaling the infrastructure to ISP outreach and reputation monitoring to whitelist services and real-time analytics.

Recently we migrated one client from IaaS to PaaS and faced an interesting challenge where Sitecore’s OOTB Workflow was trying to send an email and it was failing due to SMTP configurations.

We wanted to get this fixed without overriding Sitecore code and have minimal impact on this change. You are also looking forward to doing the same? Then this post might help you!

Solution:

As you do, We also did a quick google search and came across this blog: https://sitecore.stackexchange.com/questions/8809/sitecore-and-sendgrid

We tried those configurations. But no luck 😦

As per this document: https://sendgrid.com/docs/for-developers/sending-email/v2-csharp-code-example/ there are a couple of options to use SendGrid:

  1. Using SendGrid’s C# Library
  2. Using .NET’s Built-in SMTP Library

We wanted to avoid the options #1 route as it would cause overriding a few Sitecore’s OOTB methods.

We also created a Sitecore patch file that overrides default MailServer configuration and uses SendGrid specific details. (You need to provide exact values for following variables)

<?xml version="1.0"?>
<configuration xmlns:role="http://www.sitecore.net/xmlconfig/role/" xmlns:set="http://www.sitecore.net/xmlconfig/set/">
	<sitecore>
		<settings>
			<setting name="MailServer" set:value="#{SendGrid.SMTP.server}" />
			<setting name="MailServerUserName" set:value="#{SendGrid.SMTP.username}" />
			<setting name="MailServerPassword" set:value="#{SendGrid.SMTP.password}"/>
			<setting name="MailServerPort" set:value="#{SendGrid.SMTP.port}" />
		</settings>
	</sitecore>
</configuration>

Just a note: If you would like to enable SSL. Then you can configure that using following setting. <setting name=”MailServerUseSsl” value=”true”/> Which I believe is new in Sitecore 9.3 (Default value is false)

But that didn’t fix our issue. After digging more we figured out that the above configurations are only applied when an email is being sent using Sitecore.MainUtil.SendMail() method.

Post refactor we figured out that method which was causing issue has been using System.Net.Mail.SmtpClient.Send(); method. Which doesn’t respect the above changes and relies mainly on the Web. Config configuration values. Based on the above learning, we made the following changes and that fixed our issue (You need to provide exact values for following variables):

<system.net xdt:Transform="InsertIfMissing">
    <mailSettings xdt:Transform="InsertIfMissing">
      <smtp xdt:Transform="InsertIfMissing">
        <network host="__SendGrid.SMTP.server__" password="__SendGrid.SMTP.password__" userName="__SendGrid.SMTP.username__" port="__SendGrid.SMTP.port__" />
      </smtp>
    </mailSettings>
  </system.net>

Long story short, If you want to use SendGrid then you have to make changes at couple of places:

  1. Patch MailServer setting values
  2. Update Web.Config for System.Net Node

I’ve also created gist for your ease :

Let me know if this helped you or you learned something new while implementing this which others should be aware of.

SXA Pipelines Cheatsheet

$
0
0

Challenge:

Pipelines have been core of Sitecore’s basic architecture. As SXA has been built on Sitecore architecture it is also following those footsteps.

We’ve recently solved a few interesting use cases using SXA Pipelines. The SXA Pipelines document (https://doc.sitecore.com/developers/sxa/93/sitecore-experience-accelerator/en/the-sxa-pipelines.html) has lot of great information. But it’s hard to locate this page as well as visualize all these pipelines (At least for me).

I was thinking to create something visual which gives you an overview of SXA Pipelines. And that’s how this post came into existence.

Solution:

Reference: https://doc.sitecore.com/developers/sxa/93/sitecore-experience-accelerator/en/the-sxa-pipelines.html

The SXA Pipeline (9.3)

Hope this helps you visualize all SXA Pipelines. Thanks to the Sitecore team for this: https://doc.sitecore.com/developers/sxa/100/sitecore-experience-accelerator/en/index-en.html#

Happy Sitecore SXA Development! 🙂

Comparison between Sitecore Custom and SXA Approaches

$
0
0

Challenge

Sitecore supports Various development approaches:

Image Credits and blog reference

If you have been using the Sitecore Custom Development approach for a long time and haven’t heard about SXA yet. I would strongly recommend you to read more about it. You might like my earlier post: Sitecore SXA Basics

Or you have already learned about SXA and currently trying to figure out:

  • How can you move from the Sitecore Custom approach to SXA approach?
  • What are various approaches to do something in SXA compared to the Sitecore Custom approach?

Then this post is for you.

When we started exploring SXA. We had similar questions in our mind.

For my mind mapping, I used to compare each SXA approach with the Sitecore Custom Development approach. So, my mind can visualize and understand it.

Sharing Knowledge Quotes. QuotesGram
Image Credits : https://in.pinterest.com/pin/241083386281330040/

Thought to share my learnings with you!

Solution

I’ve listed down the following table, Which compares various approaches for specific requirements.

RequirementSitecore Custom approachSXA approach
Multi siteConfig Driven : https://doc.sitecore.com/developers/100/platform-administration-and-architecture/en/configure-multiple-managed-websites.htmlSitecore Item Driven : https://doc.sitecore.com/developers/sxa/100/sitecore-experience-accelerator/en/manage-multiple-sites-with-the-sxa-site-manager.html   https://doc.sitecore.com/developers/sxa/100/sitecore-experience-accelerator/en/tenants.html
LayoutNeeds custom developmentOOTB : https://doc.sitecore.com/users/sxa/100/sitecore-experience-accelerator/en/layout.html
Page DesignConfigured on Template’s standard valuehttps://doc.sitecore.com/developers/sxa/100/sitecore-experience-accelerator/en/recommendations–structuring-pages.html#UUID-d7d17364-b635-606b-41df-eb2f39df385e_section-idm46212287364752_body   https://doc.sitecore.com/developers/sxa/100/sitecore-experience-accelerator/en/page-designs.html
ComponentsNeeds custom developmentOOTB Various Components are already available : https://doc.sitecore.com/developers/sxa/100/sitecore-experience-accelerator/en/components.html   And it also allows you to tailor it as per your needs or create your custom component   Customize OOTB Component’s views per site : https://doc.sitecore.com/developers/sxa/100/sitecore-experience-accelerator/en/customize-rendering-html-per-site.html   You can also clone rendering : https://www.markvanaalst.com/blog/sxa/making-changes-to-standard-sxa-components/ Note: Has initial learning curve.
SearchNeeds custom developmentOOTB SXA Search Components and Services : https://doc.sitecore.com/developers/sxa/100/sitecore-experience-accelerator/en/search.html
Custom Link ResolverConfig Driven : https://jammykam.wordpress.com/2015/02/03/site-specific-link-provider-for-multi-site-implementation-in-sitecore/Sitecore Item Driven : https://doc.sitecore.com/developers/sxa/100/sitecore-experience-accelerator/en/add-and-select-a-custom-link-provider.html
WorkflowNeed to assign at Template LevelSXA 10.0 : https://doc.sitecore.com/developers/sxa/100/sitecore-experience-accelerator/en/assign-a-data-source-workflow-action-in-sxa.html   Earlier version (Rule based and custom development) : https://www.mastertoweb.com/blog/assign-default-workflows-to-sxa-items-without-creating-new-templates/
SecurityNeeds custom development and configurationhttps://doc.sitecore.com/developers/sxa/100/sitecore-experience-accelerator/en/set-up-security-for-a-tenant-and-a-site.html
Site CloningNeeds custom developmentOOTB : https://doc.sitecore.com/developers/sxa/100/sitecore-experience-accelerator/en/clone-an-sxa-site.html
Front end – Back end integrationFED and BED works in isolated mannerCreative Exchange Live : https://doc.sitecore.com/developers/sxa/100/sitecore-experience-accelerator/en/working-with-creative-exchange.html   SXA 9.3 : https://www.markvanaalst.com/blog/sxa/installing-the-sitecore-sxa-cli/   Note: Has initial learning curve.
ThemeNeeds custom development and mostly coming from file systemOOTB : https://doc.sitecore.com/developers/sxa/100/sitecore-experience-accelerator/en/the-sxa-themes.html
Sitemap/Robots.txtNeeds custom development or Marketplace moduleOOTB : https://doc.sitecore.com/developers/sxa/100/sitecore-experience-accelerator/en/configure-a-sitemap.html
Error PageNeeds custom development or Marketplace modulehttps://doc.sitecore.com/developers/sxa/100/sitecore-experience-accelerator/en/generate-a-custom-static-error-page.html
Page output as JSONNeeds custom developmentOOTB : https://doc.sitecore.com/developers/sxa/100/sitecore-experience-accelerator/en/use-the-sxa-layout-service-to-model-your-pages-in-json.html
CachingNeeds to do it at each component or item levelItem Driven OOTB Configurations : https://doc.sitecore.com/developers/sxa/100/sitecore-experience-accelerator/en/set-sxa-caching-options.html

You can also locate this table from following sources:

Google Doc can be located from here

Have I missed any requirements? You would like to contribute your learning to this document? Please let me know, I will give you edit rights to update Google doc.

Hope this document helps you reduce your SXA learning curve.

Happy SXA Development! 🙂

Sitecore Azure Real-world Learnings

$
0
0

Challenge

I know you must be thinking, Isn’t it too late to post about this? as Sitecore released support for Docker and everyone is moving towards the container.

I also thought the same, As we’ve been doing Azure PaaS for the last ~3 years. I’ve been fortunate enough to work on various challenging situations for which there is no documentation available on the web.

I’ve been noticing that the Sitecore community is still learning Azure and people have a lot of questions about how Azure PaaS works. While I think the world will move to Docker in a couple of years. But till then existing deployed Azure PaaS solutions will need support as well as there will be few clients who will not be comfortable going with docker till they see Sitecore Community and Industry feedback.

This post should help you resolve your present Sitecore Azure PaaS challenges/questions.

Solution

Basics

If you are new to Azure PaaS, Then I would strongly recommend you go through the Azure 900 Fundamentals course. This course will give you basic knowledge of Azure offerings and this fundamental knowledge will surely help you. This post has explained it nicely: https://tothecore.sk/2020/07/08/microsoft-az-900-azure-fundamentals-exam-study-guide/

For the context of this post, I will not go into the basics of Cloud, Azure PaaS, Sitecore on Azure as I understand the overall community has a good understanding of this. But if you prefer to explain it. Please let me know via comment on this post. And will share basics of Azure PaaS and Sitecore

I’ve divided our learnings in various categories:

Setup

There are various ways you can deploy Sitecore on Azure PaaS.

  1. Marketplace: You can Azure portal to setup environment using Azure Marketplace. This approach is fine for learning and exploring Azure PaaS or for short term needs. For long term and complex needs, we recommend using ARM templates
  2. ARM Templates: As per this approach, you will be able to provision your Azure PaaS environments using ARM Templates. Read more: https://doc.sitecore.com/developers/91/sitecore-experience-manager/en/walkthrough–deploying-a-new-sitecore-environment-to-the-microsoft-azure-app-service.html One thing you have to remember is Sitecore’s ARM Templates: https://github.com/Sitecore/Sitecore-Azure-Quickstart-Templates/ only provision Sitecore roles and not networking components. So, you might need some manual efforts around it.

Reference links:

Quick comparison of IaaS vs PaaS

IaaS WayPaaS Way
Remote desktop to Sitecore ServerAccess Azure Portal
Check logsCheck logs using
– KUDU/Application Editor
– Application Insights
– AzureTools.aspx
Check CPU/MemoryCheck CPU/Memory using KUDU Console
Check Event logsCheck Event logs using – Diagnose and Solve Problems
Generate Memory dumpGenerate dump
– Diagnose and Solve Problems
– KUDU
Restart App PoolRestart app from Portal
Add more hardware resources Upgrade Tier
Make a quick file change– KUDU
– Application Editor
Add new CD ServerScale

Other setup related learnings:

  1. Tiers: As per my experience. This is the place where it needs more planning and research due to the nature of the Azure world – Where things evolve over the night as well as your solution’s complexity and user load.
    1. https://kb.sitecore.net/articles/835916 – Sitecore team has done a good job documenting these and provide those in default ARM Templates. But use them as a base and try to update it as per your need and Azure world updates.
    2. https://azure.microsoft.com/en-us/blog/azure-app-service-premium-tier/ – Standard Tier and Premium tier at the same rate with better hardware!
    3. https://azure.microsoft.com/en-us/updates/announcing-pricing-decrease-for-azure-app-service-on-the-premium-plan/Price reduction of 35%
  2. Elastic pool: OOTB ARM Template doesn’t come with Elastic Pool. But Elastic Pool is the most efficient way to manage your database usage!
    1. https://docs.microsoft.com/en-us/azure/azure-sql/database/elastic-pool-overview
    2. http://blog.baslijten.com/to-elastic-pool-or-not-to-elastic-pool-for-sitecore-on-azure/
  3. Plan your network layer: Before end-users start visiting your awesome site. You need to make sure your app is secure and load balancing is configured. It needs some work. Following are some good resources:
    1. https://doc.sitecore.com/developers/91/sitecore-experience-manager/en/using-azure-application-gateway-to-secure-your-content-delivery-server.html
    2. https://doc.sitecore.com/developers/93/sitecore-experience-manager/en/manage-an-application-gateway.html
    3. https://doc.sitecore.com/developers/91/sitecore-experience-manager/en/create-an-application-gateway.html
    4. https://doc.sitecore.com/developers/91/sitecore-experience-manager/en/azure-waf-and-ase.html
    5. https://suneelsunkara.wordpress.com/2019/01/10/securing-sitecore-deployed-on-azure-web-appspaas-using-application-gatewaywaf-log-analytics-and-azure-monitor/

Once you are done with the above steps. Your site should be ready for the real-world!

But before you do that, Would recommend you go through the following section which talks about performance challenges we faced and it will be good to get those taken care of before you go-live or if you are already live and facing performance issues following section should help you.

Performance and Troubleshooting

  1. Sitecore logs: Where are your Sitecore log files? I’ve seen the majority of people struggling here. There are the following approaches using which you can access your Azure PaaS Sitecore log files:
    1. Application Insights is one way to query log data
    2. https://kb.sitecore.net/articles/911837#AccessingSitecoreLogs – You can also use AzureTools.aspx which is a Client page which queries application insights data [Read more: https://www.sitecoregabe.com/2018/09/azure-paas-sitecore-logs-using-azureailogs.html]
    3. App_Data/logs folder should be able to give you the latest log file. I’ve been using those for my Sitecore 9.3 version. I guess it was not enabled in 9.0.2. Tried to find official information. But was unable to locate it. You can read more about this approach from here: http://sitecore.skowronski.it/sitecore/how-to-get-the-latest-logs-from-azure-with-kudu/
    4. FTP – Personally – I haven’t used this approach. But you can give it a try if you like it!
    5. Good read :
      1. https://jeffdarchuk.com/2019/05/03/dude-wherere-my-logs-azure/
  2. Advanced tools: If the log file is not giving you all information then you might need to use your advanced tools from your armory! Let’s see how you can use those in Sitecore Azure PaaS world:
    1. KUDU is your friend!
    2. Memory/Crash Dump has been my biggest friend for live issue troubleshooting. You can generate a dump using this approach: https://kb.sitecore.net/articles/111669 – Some screenshots are old. But you should be able to figure it out. The initial steps are same.
    3. Application map: If you want to see dependency information getting logged then you should enable application map: https://kb.sitecore.net/articles/201177 – This should be able to help you pinpoint the root cause of an issue.
  3. REDIS timeout: REDIS is critical from a performance point of view. I’ve already shared my learnings on this here: https://sitecorebasics.wordpress.com/2020/02/15/redistimeoutexception-with-sitecore-9-0-2-9-3/
  4. FCN Mode: If your application is crashing and the domain is getting recycled frequently (You can find such information from event logs) then you might be impacted by the FCN issue. Read more about FCN mode here: https://shazwazza.com/post/all-about-aspnet-file-change-notification-fcn/ In Sitecore Media files are stored as a blob in DB and upon the first request, Sitecore creates your media output on the fly and stores it in MediaCache which is filesystem based and if FCN mode is enabled then it will recycle app pool as ASP.NET thinks there are a lot of file system changes happening and app pool should be recycled. It will be good to disable fcnMode in Web.Config. (httpRuntime fcnMode=’Disabled‘). But once you make this change then if you make any quick change in .cshtml or .aspx it won’t be reflected till the next app pool recycle. So, please read more about this before disabling it.
  5. Most important
    1. Stick to basics!
    2. Everything is still Sitecore — So, please apply your older learnings as well e.g. Checking stats.aspx, Event queue etc.

Hope this helps!

Good reads:

My Journey to become Sitecore MVP


SXA Frontend (FED)-Backend (BED) Development Flow

Workflow bundling bug

$
0
0

Challenge:

Since Sitecore 8.2 there is a hidden gem which allows you to do workflow bundling.

Workflow bundling means – When you move a page from one state to another using Experience editor only. All the associated component’s data sources on that page also move along with the page.

I’m surprised that this is not very well documented feature :

Following blog post has done good job outlining this (Thanks jammykam)

https://jammykam.wordpress.com/2016/09/05/sitecore-8-2-managing-datasource-components-and-workflow-from-the-experience-editor/ – Refer to “Workflow Bundling” section

If you don’t want to read the above post then for you – This flag controls workflow bundling behavior (Default value is true): “WebEdit.AffectWorkflowForDatasourceItem”

We have been happily using this functionality. But it stopped working and we couldn’t easily figure out when that happened as we were in between of new implementation.

If same is going on with you guys/girls as well. Then this post is for you!

Solution:

We started tracking all changes we made around this feature and we figured out that we had to disable comments as per our client’s request:

And that change was causing this behavior – Where, If we enable comment then it will work, and as soon as we disable comment it stopped working.

We raised the Sitecore support ticket and after some back and forth. Finally, Sitecore support was able to reproduce the issue and registered this as a bug (#452470). Unfortunately, there is no hotfix to fix this.

You must have to keep Workflow comments enabled (Which is as such a good practice) to use workflow bundling.

Hope this helps you figure out why your workflow bundling stopped working! 🙂

One more thing, There is also another bug with this feature where it doesn’t approve children items of a data source – https://trnktms.com/2018/03/20/webedit-affectworkflowfordatasourceitems-collect-datasource-children-items/ (“by default, this only collects the data source items and does not the children items of a data source. This is an issue when you have something like a list component which shows the children items”)

Happy Workflow bundling! 🙂

SXA Lower case URL

$
0
0

Challenge:

As per SEO Best practice, We were trying to set all URLs to lower case for our SXA Solution.

Based on my NON-SXA Learning. I thought it will be changed in one place. But it had changed at one more place. Which I couldn’t locate easily from the documentation. So, thought to share with you to save your time!

Solution:

We made following change:

But that didn’t give us the desired results. A quick search helped us to find this post which outlines a few approaches: https://sitecore.stackexchange.com/questions/16504/sxa-search-results-render-link-url-lowercase (Thank you!)

We tried following config file and it worked!

<?xml version="1.0"?>
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
<sitecore>
<linkManager>
<providers>
<add name="localizedProvider">
<patch:attribute name="lowercaseUrls">true</patch:attribute>
</add>
</providers>
</linkManager>
<links>
<urlBuilder>
<lowercaseUrls>true</lowercaseUrls>
</urlBuilder>
</links>
</sitecore>
</configuration>
view raw LowerCase.Config hosted with ❤ by GitHub
<rules>
<!– Take redirectType="Temporary" out of production if needed – Current live site has same configuration –>
<rule name="LowerCaseRule – not including querystring" stopProcessing="true">
<match url="(.*)" />
<conditions>
<add input="{PATH_INFO}" pattern=".*[A-Z]" ignoreCase="false" />
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_URI}" pattern="^/(api)" negate="true" />
<add input="{REQUEST_URI}" pattern="^/(sitecore)" negate="true" />
<add input="{REQUEST_URI}" pattern="^/(sitecore modules)" negate="true" />
<add input="{REQUEST_URI}" pattern="^/-/" negate="true" />
<add input="{REQUEST_URI}" pattern=".*(-/media).*" negate="true" />
<add input="{REQUEST_URI}" pattern=".*(~/media).*" negate="true" />
<add input="{REQUEST_URI}" pattern=".*(~/icon).*" negate="true" />
<add input="{REQUEST_URI}" pattern="WebResource.axd" negate="true" />
<add input="{REQUEST_URI}" pattern="ScriptResource.axd" negate="true" />
<add input="{REQUEST_URI}" pattern="jsnlog.logger" negate="true" />
<add input="{REQUEST_URI}" pattern="Telerik.Web.UI.WebResource.axd" negate="true" />
<add input="{REQUEST_METHOD}" matchType="Pattern" pattern="POST" ignoreCase="true" negate="true" />
<add input="{REQUEST_URI}" pattern="^/(identity)" negate="true" />
</conditions>
<action type="Redirect" url="/{ToLower:{R:1}}" appendQueryString="true" redirectType="Temporary" />
</rule>
</rules>

One more thing — If you are also looking for a way to redirect any URL to lower case then this is a great post: https://blog.coates.dk/2018/01/15/lower-casing-rewrite-rules-breaks-the-sitecore-client/ – I had to modify it for Identity service – Added our version (Tested on Sitecore 9.3) in the gist above.

Happy SEO!

PowerShell script to delete wrong Solr Config using Search Stax API

$
0
0

Challenge:

I’m a big fan of SearchStax as it removes all challenges to install, configure and manage Solr and let experts do experts job!

To set up Solr Collections: I always prefer to use Search Stax Plugin: https://github.com/searchstax/searchstax-sitecore-plugin

I made a mistake once where I had a typo in my config.yml and It uploaded config with the wrong name. (Garbage IN, Garbage OUT) Which I wanted to delete. But there was no way to do this via the plugin. So, I had to write a power shell using Search Stax API to do it and thought to share it with you!

Solution:

Disclaimer: I’m not yet proficient in Powershell. So, feel free to modify this script if you are Powershell NINJA!

You need to provide few values in the script and you should be good!

# "Please provide authentication information."
$uname = Read-Host Prompt 'Username – '
$password = Read-Host AsSecureString Prompt 'Password – '
$password = [Runtime.InteropServices.Marshal]::PtrToStringAuto([Runtime.InteropServices.Marshal]::SecureStringToBSTR($password))
Write-Host "Asking for an authorization token for $uname"
Write-Host
$body = @{
username=$uname
password=$password
}
Remove-Variable PASSWORD
$body = $body | ConvertTo-Json
try {
$token = Invoke-RestMethod uri "https://app.searchstax.com/api/rest/v2/obtain-auth-token/" Method Post Body $body ContentType 'application/json'
$token = $token.token
Remove-Variable body
Write-Host "Obtained token" $token
Write-Host
$searchstaxUrl = 'https://app.searchstax.com'
$ACCOUNT = 'TODO' # <- CHANGE YOUR VALUE HERE
$uid = 'TODO' # <- CHANGE YOUR VALUE HERE
$NAME = 'sitecore_sitecore' # <- CHANGE YOUR VALUE HERE
$headers = New-Object "System.Collections.Generic.Dictionary[[String],[String]]"
$headers.Add("Authorization", "Token $token")
#Delete Config
$RESULTS = Invoke-RestMethod Method Delete Headers $headers `
uri "https://app.searchstax.com/api/rest/v2/account/$ACCOUNT/deployment/$uid/zookeeper-config/$NAME/"
$RESULTS = $RESULTS | ConvertTo-Json
#return $token
} catch {
Write-Error Message "Unable to get Auth Token. Error was: $_" ErrorAction Stop
}

You can find API Documentation from here : https://www.searchstax.com/docs/staxapi2ZK/#zkdelete

Sitecore Learning Mind map

Viewing all 178 articles
Browse latest View live