Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Display Field Title alongside default [No text in field] placeholder when value not set - https://ticdevs.com/developers/presentation/page-editor/fixing-blank-fields - Thanks for @nshack31 for the find
<?xml version="1.0"?>
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
<sitecore>
<pipelines>
<renderField>
<processor patch:before="*[1]" type="MyProject.CMS.Custom.Pipelines.RenderField.ShowTitleWhenBlank, MyProject.CMS.Custom" />
</renderField>
</pipelines>
</sitecore>
</configuration>
using Sitecore.Pipelines.RenderField;
namespace MyProject.CMS.Custom.Pipelines.RenderField
{
public class ShowTitleWhenBlank
{
public void Process(RenderFieldArgs args)
{
args.RenderParameters["show-title-when-blank"] = "true";
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.