HIDING THE ERASE BUTTON ON SINGLE RECORD SECTIONS (VERSION 3.54+) - Jan 7th, 2021


User MercerDesign wanted to know if there was way to remove the erase button from the single record section editor, the
button that sits next to the Save, Preview and Cancel buttons, so that client's who had access to the CMS back end could
not erase the section by mistake.

Interactive Programmer Hans Marcon suggested adding the following code to lib/menus/header.php replacing "section_name"
(keeping the quotes) with the name of the section where you want the "Erase" button to be hidden, and
$your_admin_sectionRecord['hide_the_erase_button'] with the name of the 'Hide The Erase Button' checkbox in one of your
admin single record sections, so that you can turn the erase button on and off.


<?php if($your_admin_sectionRecord['hide_the_erase_button'] == 1 && isset($_GET['menu']) && $_GET['menu'] ===
"section_name"): ?>

<style type="text/css">
button.btn.btn-primary[name=Erase] {
display: none;
}
</style>

<?php endif; ?>

User Djulia also offered a plugin as a global solution that you can download from
http://thecmsbcookbook.com/downloads/hide-erase-buttons.zip. Just unzip the file, upload it to your plugin's folder and
activate the new plugin.




The materials on this web site have been created for use with CMS Builder content management software. CMS Builder software is published and licensed for use by InteractiveTools.com. Please contact Interactive Tools for information on the downloading of the software or the purchasing of licenses.


Terms of Service