Some quick questions on plugin development
-
Quick questions:
- In plugin code, what global variables or utility function can get the version of NodeBB, and the main URL of forum, without manually reading config.json?
- Can I get raw express request, response object in standard plugin hook "post:parse"?
- Plugin hook "post:parse" happened in editor page and topic view page, can I only get "post:parse" worked only on topic view page, how to differentiate it?
-
var meta = module.parent.require('./meta');
. Then,meta.config
may have the configuration (might need to double-check that).var nconf = module.parent.require('nconf');
will allow you to hook into the configuration utility we use:nconf.get('url')
returns the full url.- Unfortunately not -- our hooks are designed to keep the information passed in to a minimum.
- The
posts.parse
hook is called whenever a piece of content needs to be "parsed like a post". It is not strictly a hook that is called whenever a topic is loaded. Perhaps you can look intofilter:post.getPosts
?
Copyright © 2024 NodeBB | Contributors