Posts

Sitecore Guest Speaker - UDLA

Image
Back in January, I was invited to Universidad de las Américas (UDLA) to give a talk about Sitecore to Computer Science Students (for the second year in a row!):


The talk was focused on letting students know about the Sitecore Platform and how it is used around the world to build amazing web experiences for very demanding clients! It's important to keep in mind that the audience was 3rd-year students with basic knowledge of Content Management Systems, therefore, the topics covered were not very advanced. Some of the topics covered were:

LaunchpadDatabasesTemplatesItemsRenderingsPersonalizationScheduled TasksUser ManagerAccess ViewerContent EditorExperience EditorMarketplaceDeveloper Trial License The goal of these talks I intend to give twice a year (every year) is to let the young generations know what Sitecore is and its benefits. This is an ongoing effort on technically evangelizing computer science students in Ecuador so that when they graduate they can contribute and benefit fr…

How to implement recommendations using Coveo for Sitecore Hive

Image
When building marketplaces, having recommended products based on previous users' interactions is a feature that can have a tremendous impact on how people interact with a website. Having recommended products (or anything) does not only personalize the user experience but it can also improve sales massively. Coveo for Sitecore Hive (and also the legacy framework) has a built-in module that uses Machine Learning and the user history to recommend things that might be of interest to the context user.

This blog is not intended to replace the documentation Coveo has put in place on how to implement the Recommendations component (https://docs.coveo.com/en/648/coveo-for-sitecore-v4/getting-recommendations), however, it can serve as an auxiliary document to make the implementation of this module even easier.

There are several steps in the official documentation which I will explain here:

1. First, we need to set up the Coveo Page View Analytics component which will be in charge of logging t…

Richard Leiva - Sitecore MVP 2019

Image
I am very proud and honored to have been recognized as a Sitecore Most Valuable Professional in the Technology category. This past year was challenging and I am glad that my contributions to the community had an impact. I have now joined the selected and talented group of only 315 people among 12000 certified developers and 20000 active community members. The Sitecore community is undoubtedly one of the most active and engaging communities I have had the chance to work with and I am more than happy to be able to share my knowledge and experiences to help with the growth of the community.

I will make sure to keep it up with the good work and honor the MVP distinction. Full press release link: https://www.sitecore.com/company/press-and-media/press-releases/2019/01/sitecore-announces-2019-most-valuable-professionals

I am excited to see you all at SUGCON London and Symposium Orlando this year!

Export Sitecore Workflow History

Image
Because of audit purposes, exporting the workflow history might be a useful tool. In this post I will show you how we can create a custom button to export the workflow history to a csv file.

First, we need to create a button in the Core Database. We are going to use a Small Button and the path I chose to create the item at is: /sitecore/content/Applications/Content Editor/Ribbons/Chunks/Workflow/Export History (You can place the button anywhere you like, I just decided to place it in the workflow chunk as shown below):


After creating the small button, we need to fill in some information like the header, icon, click and tooltip fields:


On the click field, we define the command we are going to trigger when the button is clicked. I created a new command called item:ExportWorkflowHistory. In order to register this new command we need to create a config patch like this:

<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/"> <sitecore> <commands&g…

Sitecore Powershell Script to find items with an empty field

Image
I came across the necessity to build a report based on some parameters. The end goal of the script is to retrieve items that have been edited during a certain time period and that have a certain field empty.

The UI will end up looking like this:


As it can be seen in the screenshot above, the user will be able to set 4 parameters:

Root - Which is going to be the parent node we will be analyzing From Date - The start updated dateTo Date - The end updated datePages Only - When checked, only items having a layout will be present in the report Now that we know what the parameters are, let's get into the code. First we need to create the UI, to do this we use the following: 
$fromdate = $null $todate = $null $pagesOnly = $false $database = "master" $root = Get-Item -Path "$($database):\content\Home" $settings = @{ Title = "Empty Field Report" Width = "600" Height = "600" OkButtonName = "Run" Cancel…

WordPress blogs migration with Sitecore Data Exchange Framework (DEF)

Image
A couple of months ago I gave a talk for the Sitecore User Group Ecuador. As part of the talk I presented a POC (it's actually more than just a POC), which consisted in migrating existing WordPress blogs into a Sitecore instance. Throughout this post I will explain what I did to achieve this using DEF. However, I won't delve into the intrinsic details of how DEF works since there are plenty of resources in the internet. At the end of the post you will find a link to Github with the code.

DEF uses a set of items (endpoints, pipeline steps, pipeline batches, etc) to integrate with other systems. This POC is composed of:
One EndpointOne Pipeline BatchOne PipelineSix Pipeline Steps  Endpoint: 
An endpoint in DEF is an item that holds the configurations for an integration, in this case, the endpoint contains the URLs from where we are going to retrieve the posts/tags/categories:



This endpoint item uses a custom template that inherits from the DEF "Base Endpoint" template an…

Basic Auth with Sitecore

A custom attribute can be created in order to support Basic Auth with a custom API. The end goal is to be able to use a new AuthorizeAccess attribute like this:

namespace xxx.xxx.xxx { [AuthorizeAccess(Role = @"ROLENAME")] public class TestController : ServicesApiController { [HttpGet] public IHttpActionResult FetchItem(string identifier) { var contentItem = GET ITEM BASED ON THE IDENTIFIER; if (contentItem != null) { return Ok(contentItem); } return Content(HttpStatusCode.NotFound, "Item not found"); } } }
This new AuthorizeAccess attribute has a parameter called Role which accepts Sitecore roles and can be placed at the class or the action levels depending on the requirement. The goal is to return a 404 status code if the request comes with an authorization header (username:password base64 encoded) that does not belong to the specified role.

Let's …