You can't. It's been an often requested feature, but the slugs are hard coded throughout the NodeBB codebase.
Got it , Thanks
Hi, I am customizing the default composer.
To have a better understanding of how this templating system works, I am trying to add a new variable, similar to
isTopicOrMain for a conditonal in the composer.tpl.
I noticed that
isTopicOrMain is defined in 2 files
library.js, in line:197, inside object
composer.jsin line:457, inside object
when are each definition used?
From the look it seems one is for server side and the other one is client side? Are the two object synchronized at some point then?
@erichbb direct links to the code:
Yes one is server side and one is client side.
@erichbb I think this might help you:
Of course your fields don't need to be hidden. But with this example and editing composer you should be able to add fields to composer as default. Hidden as well as visible. 👍
when does that server side code (
filterComposerBuild method) runs?
Specifically, I know it is binded to the hook
filter:composer.build method I do not know when does that hook fires.
I have put some
console.log() statements inside the
filterComposerBuild method, but I can't find the output from either brower's debug console or nodebb backend terminal (running in
And from the name of the method, it seems it is only executed once when the composer initializing?
Which hook should I bind to if I want react to interaction? (Or are hooks only relevant for server side stuff?)
Can you point me to some materials explaining how the frontend and hooks interact?
I don't complete follows their discussion on
data.submittedData and is still confused about which variable is the post data stored in and which hooks are involved when it is passed around.
Also found this, maybe relevant
Difference between templateValues and templateData