Sitecore disable the placeholder textbox in presentation details.
Requirement: We need to disable the specific rendering placeholder textbox in the presentation details of sitecore page/item.
We need to create a project with the below structure.
Patch file code.
<?xml version="1.0"?>
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/" xmlns:role="http://www.sitecore.net/xmlconfig/role/">
<sitecore role:require="Standalone or ContentManagement">
<clientscripts>
<everypage>
<script key="Feature.ShellExtensions.ContentEditor" src="/sitecore/shell/Applications/Content Manager/Feature.ShellExtensions.ContentEditor.js" language="javascript" />
</everypage>
</clientscripts>
</sitecore>
</configuration>
JS code file.
// Disable the Placeholder textbox in presentation details.
Event.observe(document, "dom:loaded", function () {
//alert('Disable placeholder');
const plhText = jQuery(".scEditorSections .scEditorFieldMarkerInputCell .scContentControl")[0].value;
if (plhText == 'headless-top-fixed') {
jQuery('#FEmbeddedEditor .scEditorSections .scEditorFieldMarkerInputCell .scContentControl').first().attr("disabled", "true");
}
});
Comments
Post a Comment