app.template
-
If you have a custom theme please add the app.template property in your header.tpl.
Here is a sample from lavender.
<script> var RELATIVE_PATH = "{relative_path}"; var config = JSON.parse('{configJSON}'); var app = { template: "{template.name}" }; app.user = JSON.parse('{userJSON}'); </script>
nodebb-theme-lavender/templates/header.tpl at master · NodeBB/nodebb-theme-lavender
A simple theme for NodeBB. Check out the theming guide that accompanies this work - nodebb-theme-lavender/templates/header.tpl at master · NodeBB/nodebb-theme-lavender
GitHub (github.com)
app.template
will give the current template the user is on and is updated as the user ajaxifies around the site. -
In my case, my theme doesn't depend on Vanilla or any other theme. Does this matter? I have like all custom templates 30+ partials.
And I'm having problems calling the {name} variable in
category.tpl
Could this have anything to do with it? I did add the code above by the way as well. -
The above code looks incorrect due to a bug in templates.js
Take a look here
nodebb-theme-lavender/templates/header.tpl at master · NodeBB/nodebb-theme-lavender
A simple theme for NodeBB. Check out the theming guide that accompanies this work - nodebb-theme-lavender/templates/header.tpl at master · NodeBB/nodebb-theme-lavender
GitHub (github.com)
You header.tpl should have that block in the <head> tag.
What problem are you having exactly?