Erase button in single record

28 posts by 5 authors in: Forums > CMS Builder
Last Post: January 7, 2021   (RSS)

Is their a way to remove the erase button from the single record section editor, the button that sits next to the Save, Preview and Cancel buttons?

By Deborah - December 8, 2020

Yes! When setting up a section editor, you can select the "Advanced" tab at the top of the screen, then check the "Disable Erase" checkbox.

~ Deborah

When I create a single record I don't get an advanced button.

By Deborah - December 8, 2020

Sorry - I missed the "single record". You are correct - there is not an Advanced tab for single sections.

Clicking "erase" button will clear the content, but does not erase the section editor. So if your concern is that the section editor will be accidentally erased, it appears that it won't.

~ Deborah

Thank you, yes I was worried about that. Although I am worried about the content being erased too, is there no way of removing the button?

By Deborah - December 8, 2020

I am not aware of a way to do that. Perhaps someone else has a suggestion.

~ Deborah

By hans - December 21, 2020

Hello, do you still need to resolve this issue?

Hans Marcon
PHP Programmer (In Training)
interactivetools.com

Ideally yes, I'm concerned my client will rease the content by mistake.

By hans - January 4, 2021 - edited: January 4, 2021

As a warning, you would like to have the option to be able to "erase" a record anyways (in case you do need to). But if you want the option to...

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

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

<?php endif; ?>

Replace section_name (keeping the quotes) with the name (of the section where you want the "Erase" button to be hidden), that which can be found via the URL of the single section editor as displayed in the preview below:

https://www.interactivetools.com/forum/forum-posts.php?postNum=2245267&download=name_of_section.png

Hans Marcon
PHP Programmer (In Training)
interactivetools.com
Attachments:

name_of_section.png 20K