0.7.0 Breaking Changes
-
-
home.tpl has been renamed to categories.tpl, If you have custom themes that are overriding home.tpl you should rename it to categories.tpl.
Also widget-essentials has been updated so that all the widgets are in a subfolder now. This should prevent conflicts with template files from core.
-
Deprecation Notice:
For plugin developers, previously, this method was the only way to add a button to the composer, but it had the disadvantage of only appending buttons, which also happened to mean the "Help" button ended up in the middle of the buttons, when it should rightfully be at the end.
A new server-side hook: filter:composer.formatting was added, allowing you more control over where buttons are placed.
Inspect how the Markdown plugin adds buttons to the composer
-
filter:search.query
paramaters changed, The new hook looks likeplugins.fireHook('filter:search.query', { index: index, content: content, cid: cids, uid: uids }, callback);
Updating to latest master/0.7.0 requires a reindex of content from the search plugin ACP.
-
Made a index change for mongodb, relevant commit https://github.com/NodeBB/NodeBB/commit/484ad33549ce78d2907b1a1b9bde373b2737491a
If you update to latest, stop nodebb, go into your mongodb database and drop the indexes on the objects collection with
db.objects.dropIndexes()
they will be recreated when you restart nodebb. -
templates.js 0.2.x changes
1. Namespace Assumption - deprecated
Previously within a loop you had a choice of doing
{myarray.myprop}
or just{myprop}
. The latter has been deprecated:myarray: [ { myprop: myval } ]
<!-- BEGIN myarray --> {myarray.myprop} {myprop} // this will now only reference myprop from the root, and no longer work for myarray.myprop <!-- END myarray -->
That said, you can use
{../myprop}
which will reference the current namespace. This is useful when you re-use partials in multiple templates. For example:// partials/mypartial.tpl {../myproperty}
<!-- BEGIN loop1 --> <!-- IMPORT partials/mypartial.tpl --> // {loop1.myproperty} <!-- END loop1 --> <!-- BEGIN loop2 --> <!-- IMPORT partials/mypartial.tpl --> // {loop2.myproperty} <!-- END loop2 -->
2. All keys are now escaped by default
If you happen to include JavaScript in your template, (ex.
{code}
) please use{{code}}
instead to ensure your JS isn't escaped. -
@psychobunny Is it possible to make this more backwards compatible by making
{{code}}
escape and{code}
not escape? I feel like this would be a better way of making this change. -
I want to escape by default, to prevent accidental XSS. If you intentionally want to allow scripts then you should use double curly brackets
I think its something I would rather break today than worry about it in future