-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#3215 Adds ability to create template from doctype editor #3366
#3215 Adds ability to create template from doctype editor #3366
Conversation
Hi @skttl , Thank you for the PR. I shall give your PR a spin and shall let you know. I am going to try and test it for the following scenarios
If there are any cases you can think of let me know. Regards, |
Hey @skttl , I have given the functionality a quick test. For a doc type with no default template it adds a new template and uses that as default. But when I try to add a new template to a doc type which already has a default one it creates a template and adds it as well which is fine but then I have got 2 templates with the same name and I think it could be confusing for someone who is doing it for the first time and not quite thorough with the functionality. Do you think you can append a "(1)" to the end of the template to make it more clear? Below is the screenshot for this. Also I noticed that once you add a new template and click away from the doc type, the new template still remains in the tree and I am wondering whether this could lead to a situation where number of templates are created and left there doing nothing. One thing I can think of it to show the notification to say "Are you sure..?" but thats not something the templates screen does even otherwise when you choose another template and move away. @nul800sebastiaan thoughts on all of the above? Poornima |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @skttl! While we think it is really cool to have a button here, @poornimanayar has already discovered the flaw in this: what if there already is a template?
We can accept this PR if you show the button only if you do NOT yet have a template for a document type.
We actually don't want to encourage people having multiple templates on a single document type, it should be something rare. Adding a button to add more templates will just give people an incentive to create a template without thinking about it.
Can you update this PR with that requirement in mind please?
Hey @skttl , I have tested this again and it works as advertised :-) Happy to approve this and thank you for the nice little feature! Poornima |
src/Umbraco.Web.UI.Client/src/views/documenttypes/views/templates/templates.html
Outdated
Show resolved
Hide resolved
Co-Authored-By: skttl <[email protected]>
Prerequisites
Description
I added a button for creating a new template in the template view of the doctype editor. The button uses the template resource to fetch a template scaffold, and then save a new template. After saving, the template gets selected as allowed, and if there is no default template selected, the new template will also be the default.
https://i.imgur.com/KQbmjGH.gifv