How to set meta tag in plugin ?

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

  • NodeBB

    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);
    };
    

Suggested Topics

  • 0 Votes
    1 Posts
    227 Views

  • 0 Votes
    8 Posts
    1488 Views

  • Best way of forking a plugin?

    Unsolved Plugin Development
    0 Votes
    2 Posts
    1223 Views

  • 2 Votes
    18 Posts
    5271 Views

  • 0 Votes
    3 Posts
    1965 Views

| | | |