Register pipe templates
You can define template for your pipe.
There are two template types:
SearchItemTemplate- for creating a search index.PublishingItemTemplate- for creating a publishing point.
To register a template for a pipe, you use the RegisterTemplatePipe method:
C#
using System.Collections.Generic;
using Telerik.Sitefinity.Publishing;
using Telerik.Sitefinity.Publishing.Model;
using Telerik.Sitefinity.Publishing.Pipes;
using Telerik.Sitefinity.Publishing.Translators;
namespace SitefinityWebApp
{
public class RegisterPipeTemplates
{
// <summary>
/// Registers pipe templates.
/// There are two template types:
/// - SearchItemTemplate - for search index publishing point
/// - PublishingItemTemplate - for default publishing point
/// </summary>
public static void RegisterThePipeTemplates()
{
// Get the default pipe settings. For custom pipe use MyPipe.GetTemplatePipeSettings()
PipeSettings defaultContentInboundPipeSettings = ContentInboundPipe.GetTemplatePipeSettings();
// To register a template for a pipe, use the RegisterTemplatePipe method
// The template is part of the settings. With registering the SearchItemTemplate, we add the inbound pipe as an option when creating a search index.
PublishingSystemFactory.RegisterTemplatePipe("SearchItemTemplate", defaultContentInboundPipeSettings);
}
public static List<Mapping> CreateCustomMappings()
{
List<Mapping> mappingsList = new List<Mapping>();
var contentMapping =
new Mapping()
{
DestinationPropertyName = "Content",
IsRequired = true,
SourcePropertyNames = new[] { "Title" }
};
mappingsList.Add(contentMapping);
var linkMapping =
new Mapping()
{
DestinationPropertyName = "Link",
IsRequired = true,
SourcePropertyNames = new[] { "Link" }
};
linkMapping.Translations.Add(new PipeMappingTranslation() { TranslatorName = UrlShortenerTranslator.TranslatorName });
mappingsList.Add(linkMapping);
return mappingsList;
}
}
}
The template is part of the settings. With registering the SearchItemTemplate, you add your inbound custom pipe as an option when creating a search index.
Want to learn more?
Enhance your Sitefinity skills by enrolling in free training sessions. Become Sitefinity certified through Progress Education Community to strengthen your professional credentials.
Get started with Integration Hub | Sitefinity Cloud
This free lesson teaches administrators, marketers, and other business professionals how to use Sitefinity Integration Hub to create automated workflows between Sitefinity and other business systems.
Web Security for Sitefinity Administrators
This free lesson teaches administrators the basics about protecting your Sitefinity instance and your sites from external threats. Configure HTTPS, SSL, allow lists for trusted sites, and cookie security, among others.
Foundations of Sitefinity ASP.NET Core Development
The free on-demand video course teaches developers how to use Sitefinity ASP.NET Core and take advantage of its decoupled architecture and modern development model.