Using The Build Hook on Tpl Files That Are Inside Folders
Solved
NodeBB Development
-
Hey again. When trying to run the build hook on a template file that is inside a folder, it doesn't seem to be run.
I have the following structure for my example:
Root Folder: Template -
File 1: users.tpl -
Subfolder: Partials -
File 2: users_list.tplIf I was to use the following hooks:
{ "hook": "filter:users.build", "method": "usersBuild" }, { "hook": "filter:user_list.build", "method": "userListBuild" }
The first hook would be executed, but the second one would not.
Is there something I am missing / not understanding? -
users_list.tpl
is a partial so it is not directly rendered in nodebb core withres.render(templateName, data)
that's why the hook won't fire for it.What are you trying to do in
userListBuild
? You can probably do it in theusersBuild
hook by accessing the user data intemplateData.users
Copyright © 2024 NodeBB | Contributors