How to set meta tag in plugin ?



  • How to set meta tag in plugin ?
    ex:
    <meta name="tags" content="abc, def" />


  • Admin

    Starting with 1.6.0 you can use plugins.fireHook('filter:meta.getMetaTags', { req: req, data: data, defaultTags: defaultTags }, next);

    If you want to do it on 1.5.2 you can try the below using the the hook filter:topic.build.

    myPluign.onTopicBuild = function (hookData, callback) {
        hookData.res.locals.metaTags.push({  property: 'tags', content: 'abc, def' });
        callback(null, hookData);
    };
    

Log in to reply
 


Looks like your connection to NodeBB was lost, please wait while we try to reconnect.