0

I need to add a delete button to a node edit form, so in case I open a edit form of the node I want to have a possibility to delete it as well. This edit node form is genereted from a view using Link to edit Content and displayed in modal window, which adds the following markup to the page.

<a href="/node/597/edit" class="use-ajax" data-dialog-type="modal" >Link to edit node</a>

How can I programmatically achieve this in Drupal 8?

  • There's already a delete link on that form, any reason you need another one? – Clive Sep 5 '18 at 9:57
  • No, there is no delete button. Only save one is presented. – JarJar Sep 5 '18 at 11:11
  • 2
    Then you don't have permission to delete the node. Adding a button won't help, the operation will still be denied – Clive Sep 5 '18 at 11:13
  • I'm an admin, I have all permissions. I think I missed few things in my description. This edit node form is genereted from view using Link to edit Content and display in modal window - <a href="/node/597/edit" class="use-ajax" data-dialog-type="modal" >Link to edit node</a> – JarJar Sep 5 '18 at 11:54
0

There is a "Delete" Link right to the "Save" Button. If you can't see it, you're missing the "delete content of type x" permission. If you need the Link styled as button, use the matching css classes of your theme.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.