How to invoke ?

NodeBB Development
  • I am working on a search plugin.

    There're two filters available for topic & post :

    • filter:search.query = function(data, callback) {'enter search')
    	return callback(null, []);
    plugin.searchTopic = function(data, callback) {'enter topic search')
    	return callback(null, []);

    now I can see the log in search after I search something, as well as advanced search. But searchTopicnever show.

    Can someone tell me how to invoke this filter ?

Suggested Topics

  • 1 Votes
    5 Posts

    Help me pls )

  • 0 Votes
    10 Posts

    Such a great post to know different useful information.

  • 5 Votes
    1 Posts

    Related issue

    As discussed in the issue, we had a bunch of hooks to modify a page on some routes like These were added as required but most pages didn't have a hook so if you needed one you would have to ask us to add it and wait for the next release. With the above change every route has a hook. The hook name is derived from the template name passed to the res.render(template, data); method. For example if your template is named myAwesomePage, you render it with res.render('myAwesomePage', data); and the hook that will be fired is

    Every hook gets 3 parameters {req: req, res: res, templateData: data}, data is the parameter you pass into the res.render method.

    We had a few inconsistencies in the parameters passed to the hook and the hook name below are the changes that needs to be fixed if you have a plugin that is listening to these hooks. is now called filter:group/ as that is the correct name for that template. used to pass in a extra term parameter, this moved into the templateData parameter. this is removed it was deprecated a while ago. Use filter:navigation.available instead. parameters changed, data is no longer passed in use req.query and req.params instead. results is now the templateData parameter.

    Feel free to ask any questions if anything isn't clear.

  • 0 Votes
    1 Posts

    In my topic.tpl I made some changes using @first to separate first post in topic from others. It worked, but there is now next problem. When i create a new post it doesn't show it instantly, I have to refresh page to see that post.

    This is how my topic.tpl looks now

    Also, I noticed this . Instead of just creating one more <li> in .otherPosts div it creates another .firstPost and .otherPosts div.

    I think that maybe I made some mistake with using @fist but I can't figure out what is it. Someone help? 🙂