Hi,
I really love the template approach and the additional functionality it provides such as template clone etc.
I have a usecase where the client would like only the custom templates available in the interface. We do not need the default templates but would like to retain the template functionality! Is there a quick / recommended way to provide only the bespoke templates?

Comments

dakku created an issue. See original summary.

jrockowitz’s picture

The only approach to never installing the default templates is removing them via a patch which adds a webform_templates_install() hook that deletes the template.

@see #2888250: Remove default contact webform.

jrockowitz’s picture

Status: Active » Needs review
StatusFileSize
new952 bytes

The attached will delete the webform_templates.module during the module's installation.

jrockowitz’s picture

Using a patch is simplest solution.

The other solutions I can think of are…

  • Provide an advanced webform configuration settings
  • Provide a bulk delete templates button
  • Add 'Delete' button/link to Template overview
  • Add 'Manage' tab to Templates which allows templates to be deleted
dakku’s picture

@jrockowitz
I like the idea of:
Add 'Delete' button/link to Template overview

If you are open to getting this feature added, I can rustle up a patch that would provide a "delete" button next to each template. So it would be:

Select | Preview | Delete

dakku’s picture

Hi @ jrockowitz

Here is a quick patch that implements template deletion button.
See screenshots below:

delete step 1
delete step 2
delete step 3

dakku’s picture

Title: Ability to disable default templates? » Ability to delete default templates?
jrockowitz’s picture

StatusFileSize
new1.19 KB
new191.43 KB

@dakku I kind of suspected that adding a delete button the main Templates display would be awkward looking.

The other approach would be to add dedicated 'Manage' tab to the 'Templates' section.

When I searched other Form Builder applications, no one offers the ability to delete templates.

The attached patch changes the 'Delete' button to a red link and it is only visible to users with 'administer webform' permission.

jrockowitz’s picture

I still think the Delete link looks awkward and we should explore creating a Manage tab which would include an Edit, View, and Delete operation dropdown.

dakku’s picture

Personally, from a user experience perspective, I think it makes sense to have the template related operations on a single page. This is the same behaviour for core Content view for example.

Not to mention the duplication of code to move it to a new tab just to add a delete button?

jrockowitz’s picture

My thinking is once a websites templates are set up no one needs to delete them,

Only when an site administrator is managing the template will they need to delete them.

jrockowitz’s picture

StatusFileSize
new11.46 KB

The attached patch adds a 'Manage' tab to 'Templates' and a 'administer webform templates' permission.

  • jrockowitz committed 060baf8 on 3007041-manage-templates
    Issue #3007041 by jrockowitz, dakku: Ability to delete default templates...
jrockowitz’s picture

StatusFileSize
new11.46 KB

Minor tweaks.

  • jrockowitz committed 3b525db on 3007041-manage-templates
    Issue #3007041 by jrockowitz, dakku: Ability to delete default templates...
jrockowitz’s picture

Here is the change record.

dakku’s picture

Status: Needs review » Fixed

@jrockowitz thank you - this is awesome :D

  • jrockowitz committed 31a13da on 8.x-5.x
    Issue #3007041 by jrockowitz, dakku: Ability to delete default templates...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.