Problems, need help? Have a tip or advice? Post it here.
5 posts Page 1 of 1
hi, working with snippets in the backend admin that is displaying information stored via db_persist and showing information as a "receipt" so there is no editing of data.

So with that in mind,

- I wanted to change the text "edit" to something else like "viewing receipt for %name%" or something
- and remove the "add new" at the top as there is no way to make a new donation without going through the form on website.

I was able to remove the save/view at the bottom as that was in the my_edit.html but I cannot find the Add New and the Text at the top so I believe this is part of couch and not part of the snippet.

Any way to hide and change those two things?

Screenshot: http://d.pr/i/10ap3
Hi again, John. :)

We can use the "message" type editable region to hack the admin panel with custom CSS and JS. In this case, the quick and easy thing would be to remove the unwanted parts with CSS.
Code: Select all
    <cms:editable type="message" name="admin_hack">
        <style>
           #admin-wrapper-header h3, #create_new{display:none;}
        </style>
    </cms:editable>

If you wanted to change the text from "Edit" to something else rather than remove it, you could use JavaScript to change its inner html instead.

This would affect the "edit page" view of the template. There is also an "Add New" button on the template's list view in the admin panel. As far as I know, there's no easy way to change or affect the list-view.
Hi Tim,

Thanks again for once again helping out.

I placed that in the template itself and the my_edit.html and neither made any changes.

I would prefer to just change the text from Edit to Viewing Receipt.

Hopefully someone else or KK may know how or if its possible to hide the add button.

tim wrote: Hi again, John. :)

We can use the "message" type editable region to hack the admin panel with custom CSS and JS. In this case, the quick and easy thing would be to remove the unwanted parts with CSS.
Code: Select all
    <cms:editable type="message" name="admin_hack">
        <style>
           #admin-wrapper-header h3, #create_new{display:none;}
        </style>
    </cms:editable>

If you wanted to change the text from "Edit" to something else rather than remove it, you could use JavaScript to change its inner html instead.

This would affect the "edit page" view of the template. There is also an "Add New" button on the template's list view in the admin panel. As far as I know, there's no easy way to change or affect the list-view.
Sorry that didn't work. I'm not sure I understand about using snippets in the admin panel, so maybe there's some kind of conflict I'm unaware of.

If you view the source code for the admin panel page in your browser, or right-click on the element and choose "inspect element", you'll see the element's id. You should be able to then target that element using CSS or JavaScript as demonstrated in the code snippet above.

I would prefer to just change the text from Edit to Viewing Receipt.

It would require JS to change the text. Writing CSS is easier than JS, so I chose the lazy method. :)
Go to /couch/lang/EN.php and edit strings there as you wish. I often do this and change Folders to Albums for galleries and some other custom labelling.
Join COUCH:TALK channel here https://t.me/couchcms_chat
Ryazania — a framework to boost productivity with Add-ons viewtopic.php?f=2&t=13475
Support my efforts to help the community https://boosty.to/trendo/donate
5 posts Page 1 of 1