[17.6.0] New workflow for custom templates

@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

1 Like

@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

2 Likes

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.

1 Like

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.

2 Likes

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.

2 Likes

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.

1 Like

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 :+1:t2:

Thank him.