Skip to content

Instantly share code, notes, and snippets.

@jammykam
Last active August 15, 2017 20:44
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jammykam/10ae88efc3ebae047ff0bd22228a3903 to your computer and use it in GitHub Desktop.
Save jammykam/10ae88efc3ebae047ff0bd22228a3903 to your computer and use it in GitHub Desktop.
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