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>
https://github.com/NodeBB/nodebb-theme-lavender/blob/master/templates/header.tpl#L20-L27
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
https://github.com/NodeBB/nodebb-theme-lavender/blob/master/templates/header.tpl#L20-L27
You header.tpl should have that block in the <head> tag.
What problem are you having exactly?