This is an examle of how to add a processor to the renderField pipeline to replace content authored text with preconfigured text.
Example:
Content author inputs:
Copyright © Some Company
This gist will override the output:
$items = gci . -Recurse | |
Foreach($item in $items) { | |
$allRenderings = Get-Rendering -Item $item -FinalLayout | |
$dynamicRenderings = $allRenderings | Where-Object {$_.Placeholder -match '(-{[0-9a-fA-F]{8}[-][0-9a-fA-F]{4}[-][0-9a-fA-F]{4}[-][0-9a-fA-F]{4}[-][0-9a-fA-F]{12}}-0)'} | |
$regexOptions = ([System.Text.RegularExpressions.RegexOptions]::MultiLine -bor [System.Text.RegularExpressions.RegexOptions]::IgnoreCase) | |
$regex = new-object regex('{[0-9a-fA-F]{8}[-][0-9a-fA-F]{4}[-][0-9a-fA-F]{4}[-][0-9a-fA-F]{4}[-][0-9a-fA-F]{12}}', $regexOptions) |
namespace Sitecore.Foundation.SitecoreExtensions.FieldTypes | |
{ | |
using System; | |
using System.Linq; | |
using Sitecore.Data.Items; | |
using Sitecore.Foundation.SitecoreExtensions.Extensions; | |
using Sitecore.Web.UI.HtmlControls; | |
using Sitecore.Web.UI.Sheer; | |
using Control = System.Web.UI.Control; |
This is an examle of how to add a processor to the renderField pipeline to replace content authored text with preconfigured text.
Example:
Content author inputs:
Copyright © Some Company
This gist will override the output:
namespace Example | |
{ | |
using System; | |
using System.IO; | |
using System.Net; | |
using System.Text; | |
using System.Threading.Tasks; | |
using Abstractions; | |
public class HttpService : IHttpService |
namespace NavArts.Insights.Pipelines.GetPageEditorNotifications | |
{ | |
using System; | |
using System.Linq; | |
using global::Sitecore.ContentSearch.Fluent; | |
using global::Sitecore.ContentSearch.Utilities; | |
using global::Sitecore.Data; | |
using global::Sitecore.Data.Items; | |
using global::Sitecore.Diagnostics; | |
using global::Sitecore.Pipelines.GetPageEditorNotifications; |
namespace NavArts.Sitecore.Search.ComputedFields | |
{ | |
using System; | |
using System.Linq; | |
using System.Xml; | |
using global::Sitecore.ContentSearch; | |
using global::Sitecore.ContentSearch.ComputedFields; | |
using global::Sitecore.Data; | |
using global::Sitecore.Data.Fields; | |
using global::Sitecore.Diagnostics; |
namespace NavArts.Sitecore.WebEdit | |
{ | |
using System; | |
using System.Collections.Specialized; | |
using global::Sitecore; | |
using global::Sitecore.Configuration; | |
using global::Sitecore.Data; | |
using global::Sitecore.Data.Fields; | |
using global::Sitecore.Data.Items; | |
using global::Sitecore.Diagnostics; |