Note: This feature is available in the Classic Editor only.
Script code blocks may be safely inserted into an editable region using CodeProtect. These script code blocks are represented in the editor interface by a red question mark icon, as shown below:
CodeProtect regions may be inserted or edited by clicking on the CodeProtect button in the toolbar.
This opens the CodeProtect editor window. Whether creating a new CodeProtect region or editing a new one, code blocks are entered into the CodeProtect window, as shown in the following figure:
Click the Update button to insert the code block as a red CodeProtect icon in the editor. New CodeProtect regions are inserted at the current cursor location in the editor.
The purpose of CodeProtect is to allow users the ability to insert PHP, ASP, or JSP code into an editable region. ASP and JSP code must use the <% %> processing instruction notation. PHP must use the <?php ?> or <? ?> notation.
If the page is a publish control file (PCF) or any other type of XML implementation, then only PHP code blocks are allowed. This is because the ASP and JSP <% %> tagging is invalid XML. PHP blocks, on the other hand, are valid XML preprocessing instructions. XSL transformation of PHP code blocks is successful, but it will fail for ASP and JSP.