Software > Beta
2.4 template-making guide
rejetto:
we should collect instructions on how to make a tpl for 2.4
let's see make a quick list
- the default tpl is always inherited. This means that unspecified/missing sections will be still taken from the default tpl. If you want to have some sections empty then you will have to have them as empty in your tpl.
- because of the point above you should probably have your [error-page]
- because of the point above, you don't need to copy libs/sections in yours, like the sha256.
- the 'private' section flag works no more. All sections are private unless you use the new 'public' flag.
- new templates (with new login system) will be recognized by the section [api level] section. At the moment the api level required is 2.
- because of the anti-DoS system, if you make XHR/fetch requests to folders, you may get an http error 429 that means you have to retry
- if your tpl works as a Single-Page-Application and doesn't use %list% in its main section, then use the 'no list' flag. That is, put this text at the top [|no list]
am i forgetting something?
rejetto:
in RC3 you will have some new features to make tpl and diff.tpl more compatible:
[section|ver=MASK|build=MIN-MAX|template=MASK]
ver and build apply to hfs versioning, while template will match over [template id] section. MASK supports ?*; operators as usual.
Of course HFS 2.3 will not support them, but if you do |ver=2.3 it will just ignore it and keep the section, while 2.4 will know it has to skip the section.
rejetto:
to template makers,
with these new tools I think it would be better to restore the old 'selection' name instead of 'files', so that you can more easily make cross-version templates.
What you think?
I'm not totally sure that you can make a template that works both on 2.3 and 2.4 now, but maybe yes.
I may try to make a test with the default tpl itself.
dj:
What you think? it would be easier to restore the old 'selection' name.
My template works with both versions, but only if you add a diff.tpl.
This is because delphi checks, if a [unauthorized] section is in the user template.
If yes, the user template is rejected.
So you need to remove or rename it.
For compatibility reasons, it would be better, if
delphi checks, if a [unauth] section is in the user template and
if yes, the user template is allowed.
So you can write backwards compatible templates ([unauthorized=unauth]).
rejetto:
initially i thought that a tpl would have not been able to be compatible.
anyway, i was forgetting an important thing: 'files' and 'selection' are not the same. Selection has double %encoding because of past unicode problems (or bad design, not sure).
you may not notice any problem while you use just ascii for filenames.
Having no compatibility with 2.3 because of the login, I didn't have a reason to keep the double encoding. Even now I don't love the idea of keeping it, but not 100% sure. I may make extra tests to see if i find a better solution.
--- Quote from: dj on June 10, 2020, 12:08:24 PM ---For compatibility reasons, it would be better, if delphi checks, if a [unauth] section is in the user template and if yes, the user template is allowed.
--- End quote ---
the reason for that was that you now always inherit the default tpl, so you automatically inherit the unauth even if you maybe don't write one because you want to keep the original one.
I need to think on this.
Navigation
[0] Message Index
[#] Next page
Go to full version