killed my #ghost 😡
Some quick questions on plugin development
fyhao last edited by fyhao
- 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.configmay 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.
posts.parsehook 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 into