Posts

Showing posts with the label Content Hub

Create Custom Definition In Sitecore Content Hub And Display Using OOTB component

Image
In Sitecore Content Hub, definitions are blueprints that structure and classify content entities like assets, contracts, and products. They let you customize metadata, add relationships, properties, and constraints, and either extend built-in definitions (e.g., M.Asset, M.Collection, M.Content ) or create new ones based on project needs. This guide explains how to create new definitions and when they’re required We will see, how one can create its own custom definition in content hub according to business need with an example. Let’s walk through a real-world example of creating a new definition for Marketing Campaigns. In this use case, we will build a custom definition that allows your organization to track marketing campaigns with attributes like CampaignName, StartDate, EndDate, Location, MarketingAssets and CampaignStatusActive Step 1: Creating New Definition Log in to your Sitecore Content Hub instance, navigate to Manage, then search for Schema. Click on Schema, and you’ll se...

Understanding External Component in Content Hub with Use Case Using React

Image
Hello everyone, In this blog we will see how we can create external component using react in Sitecore Content Hub. In one of my old blogs, I have created a similar component using Knockout JS. We will consider the same use case to build this component but using React. Before starting our blog, I will highly encourage you to read my old blog here . Creating external component, assigning the component to Asset Details page, making it visible on the page will be exactly same as we have done in the old blog. The changes what we are going to do in Content Hub, I will add the screenshot below. Before developing the component in react, we need to setup our React front end solution. I would highly recommened to watch the youtube tutorial for setting up the front end solution here . Adding few helpful command below which is required during setup. I will provide all reference link below in reference section. // For creating new react project using Vite npm create vite@latest //Quic...

Creating Email Template In Content Hub Programmatically

Image
Hello everyone, In this blog we will see, how we can create mail template programatically in Sitecore Content Hub. So let's quickly try to see the code and we will understand it afterwwards. using System.Collections; using System.Collections.Generic; using System.Globalization; using System.Linq; using Stylelabs.M.Sdk; using Stylelabs.M.Sdk.Models.Notifications; using Stylelabs.M.Sdk.Contracts.Notifications; using Stylelabs.M.Sdk.Contracts.Base; using Stylelabs.M.Sdk.Contracts.Content; using Stylelabs.M.Base.Querying; using Stylelabs.M.Base.Querying.Filters; CultureInfo culture = CultureInfo.GetCultureInfo("en-US"); MClient.Logger.Info($"SS - Creating Email Template"); IMailTemplate template = await MClient.EntityFactory.CreateAsync(Constants.MailTemplate.DefinitionName) as IMailTemplate; template.Name = "MailNotificationReject"; template.SetSubject(culture, "SS Mail Notification Reject"); template.SetBody(culture, "Email...

Creating Custom Component in Content Hub using External Component

Image
Hello everyone, In this blog, we will see how we can add an custom component in Content Hub. We will create a component which will display all related assets based on loaded Asset title. Creating custom component depends on utilizing External Component.So we will follow below steps to achieve the same. We will be using Knockout JS for the implementation. Step1 : Adding External Page Component to Asset Detail Page Step2 : Code Logic implementing Related Asset Component Step 1 Go To Manage Page --> Search Pages --> Search Asset Details. Select Any row and click on add component basically the + symbol. In above screenshot, just click the plus symbol below Related Asset component.A popup will come up. Search for External keywork in search bar and click the result which comes up.Another popup will come and we will give our component a name and enable the visisble checkbox as shown below and click Add.The component will be added to layout. Once the component is added, just c...