@ckeoghan, @Parrot should be fixed in the latest version (17.6.25)
Hi, Thatâs great, perfect fix.
Hi Lubos, I like the way the templates work now, but there is one thing I canât work out, or that seems to have changed. I cannot seem to select a default theme, so I now have to âswitch templateâ each time I create a new sales order, or even when viewing old sales orders. Everything seems to have defaulted to the original theme provided. For example, we have renamed the Sales Order, so it is called âNotification for Paymentâ on our custom template. Now whenever I create a new âNotification for Paymentâ I have to remember to switch themes or it will be called a Sales Order again. this even happens even when viewing old sales orders / notifications for payment created months ago.
It would also be helpful to have the names of the custom templates appear under the switch theme button. I had a bunch of templates that were quite similar looking and had not been named other than Custom 1, custom 2 etc, so it was difficult to figure out which was which without examining all the code. Perhaps by clicking the switch template button a drop down list of the custom templates saved could appear? Thanks
@FCP read the link below, read all comments, it explains why it is so.
I have pointed out exactly the same two shortcomings to @lubos in a private exchange, @FCP:
- No identification of which template is being used
- Constant reversion to the default template
I hope others with similar concerns will make them known.
Yes, I agree. Although after reading the post Abeiku linked me to I now understand why it is reverting to the default template, it is rather annoying to have to keep switching theme in order to see the one you actually want to see and use. Inevitably there will be times when we press print or email this or PDF it for someone, forgetting that itâs in the wrong template, which will waste resources, time and energy. I would rather be able to select which custom template I would like to default to for each section âŚsales invoice, sales order, purchase invoice etc. Perhaps an option in the custom fields section?
Okay so going forward. âSet As Default Templateâ wonât be bad
Iâve also just noticed that if you are viewing an invoice for example and have switched themes, so it appears in the correct custom template, but then you notice something you need to edit, after you have edited and updated the invoice, the view reverts back to the default template again, which is super annoying.
I am yet to test the new invoice template, I am still using the the depreciated View Templates as that fits my needs perfectly. I am hesitant to upgrade to a invoice workflow I am unable to use at my busiest time of year unless confirmation View Templates are still supported for legacy users?
From what see on the forum and even without testing I would have to agree that being able to set default template and having template identification is a basic need.
I cannot confirm this. You could still use them initially when custom themes replaced them; but since the custom themes were so much more powerful, I deleted my old view templates after confirming my replacement themes were working. Now, of course, I canât go backwards to check. I only know that themes carried forward to the new implementation of templates. (I wish the terminology hadnât changed to something used previously, as thatâs confusing.)
Yes, we have been back and forth a few times with terminology, Lubos seems a perfectionist and likes things right, canât blame him!
Think I will just backup, download latest version when I get a chance have a tinker and revert back if needed.
Dear @lubos, please built an option to set a standard template, so this annoying, time consuming and source for using the wrong template will be history.
View Templates are no longer supported in the latest version.
See? This is the problem, everyone wants something different. @Tut is asking to set default template like it was before, you want default template per document type. There is other person on the forum who needs default template per customer/supplier group (they have multiple trading entities under single legal entity). Another person wants to set up default template per user (some users print invoices for internal use and need more information on it than accounts receivable person sending to customer).
So I really canât implement ability to set default template that easily. Maybe one exception could be made if you have exactly one custom template. Then the system could imply you want that to be default. But once you have multiple templates, you probably have more complicated rules on when given template should be used and in that case you will need to continue using Switch Template
button.
If you have multiple templates and donât want to use Switch Template
button, you will have to merge all your templates into single template and write your logic in Liquid. This way Manager is using one default template and itâs your code in Liquid which dictates what should be actually shown given the context.
I have only one custom template with if logic though (provided by isklerius), using custom field, but still has a limit by sacrifice of displaying (print) custom fields in invoice.
So the best way to overcome the variety of template usage is the liquid if trigger logic compiled by the user itself.
I like using single template and just using logic in Liquid to do switching, however for users without programming experience it is a bit hard.
From my experience building templates for myself and few other people it is usually field value driving what to show.
ie IF Custom Field (Drop Down) Business Type == Shop THEN show shipping info ELSE nothing END
Same for switching logo etc. or document type etc
What if we could select custom fields/field within templates itself and set required values to show template so no logic is required within template, but we have multiple templates with conditions to show them
ie: On template you could have section for rules something like:
Just expose available top level variables in template like title, customer, etc + custom fields
Was looking for sample online and found http://querybuilder.js.org/ not sure if you can use that
That way one could download template from library and wire logic to show. Just suggestion.
I do want to discourage businesses from having multiple templates. Adding something like this would only encourage it. The main issue is that logic can be tricky and âcondition builderâ will always have limitations while Liquid is Turing complete and wonât have any limitations.
Anyway, in the latest version (17.6.37) Iâve added the concept of default template. Basically the templates on Templates
list are sorted by Name
. The first template in the list is automatically default one.
This works great. You can easily control order of selection by prefixing the template names with numbers. Some way to identify which template you are on would still be helpful, especially since the default template is in the mix.
Who suggested drop-down for the list of templates? I didnât notice that idea but I think itâs good one since it would match user expectations better.
The latest version (17.6.38) does it this way:
Iâm still not sure about the concept of âdefaultâ template. Iâd rather have âPlainâ to be default. Maybe when you switch template on any document, Manager would âremember itâ for that particular document so when you come back to it, your template choice on that document would be preserved.
Yeah, youâd have to click Switch Template
button and select the right template for each document but it would be only once when document is created. I donât think thatâs asking too much.
I donât necessarily want a default template, but I can see it just seems a basic need for other users.
My current workflow requires me to select which invoice template anyway that doesnât bother me.
Can you guarantee that the âNewâ Templates will not be deprecated a year or so down the line? Most users now I believe, are long term users and require some sort of stability without the worry of having to rethink their invoicing workflow plus loosing their past history invoice detail that was carefully setup, maintained and worked great.
Anyway, I will upgrade later today to test.
Thanks.
----- ADD -----
The drop down looks good and manager should remember which template was used so when you go back and view that document it is exactly how you left it.
Looking forward to upgrading and testing
Thank him.