Erase button in single record

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

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

My bad, I forgot to mention it. Put it under lib/menus/header.php.

Edit: put it at the end of the code.

Hans Marcon
PHP Programmer (In Training)
interactivetools.com

By gkornbluth - January 5, 2021 - edited: January 5, 2021

Hi MercerDesign,

I don't know if it will work, but possibly you could wrap Hans' whole code block in an if statement that references a 'Hide The Erase Button' checkbox in one of your admin single record sections, so that you can turn the erase button on and off.

Like:

<?php if ( $your_admin_sectionRecord['hide_the_erase_button'] == 1):?> (Hans' code) <?php endif ?>

or just add another criteria into the beginning of Han's if statement IE:

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

Please post if this works and I'll add it to the CMSB Cookbook

Best,

Jerry Kornbluth

The first CMS Builder reference book is now available on-line!







Take advantage of a free 3 month trial subscription, only for CMSB users, at: http://www.thecmsbcookbook.com/trial.php

That does work, thank you, but ideally I want it to affect the site globally, this only works for on section editor.

Hi, I've done this by updating the theme css.

By hans - January 6, 2021

I would not recommend that. It will hide all the "Erase" buttons from other sections, which you might need.

Hans Marcon
PHP Programmer (In Training)
interactivetools.com

By Djulia - January 6, 2021

Hi MercerDesign,

Can you try this plugin?

It should be able to help you.

Thanks,
Djulia

Attachments:

erase-buttons-right.php 1K

Thank you, I've reverted the style sheet but where or how do I use this plugin?

By Djulia - January 7, 2021

You must place the file in the plugins folder, then activate the plugin in setup> plugins.

Djulia

Thank you. That has worked perfectly!