Last active
August 15, 2017 20:44
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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