how can I check if a user is querying this through API and with a valid bearer token?

Plugin Development

Suggested Topics


  • 0 Votes
    1 Posts
    83 Views

    Hi Team NodeBB,

    I am trying to create plugin to add one set image/icon field in the user setting page (user/username/settings) and this value display after user name in topic list page.

    var Plugin = {}; console.log('outside - called properly'); Plugin.addCustomFields = function(hookData, callback) { console.log('Custom Field function is called properly'); // Add your custom fields to the `fields` object here hookData.custom_field_1 = { type: 'text', required: true, title: 'Custom Field 1' }; }; module.exports = Plugin;

    could you please guide me which method i need to use and for image/icon field how to write filed attribute?

  • 0 Votes
    3 Posts
    2k Views

    @baris thanks, that is exactly what I looked for:

    var userProvidedCatIds = widget.data.catIds; if (!userProvidedCatIds || userProvidedCatIds === '0') { categories.getCategoriesByPrivilege('cid:0:children', widget.uid, 'find', render); } else { categories.getCategories(userProvidedCatIds.split(',').map(Number), widget.uid, render); } function render(err, data) { app.render('categories.tpl', { categories: data, relative_path: nconf.get('relative_path') }, function (err, html) { widget.html = html; callback(err, html); }); }

    Is there any doc-site / rtfm for the JS-API or do we have to look at the source to find appropriate methods and their parameters?

  • 0 Votes
    1 Posts
    951 Views

    Similar to something like <!-- IF !isTopicOrMain --> or <!-- IF !isEditing -->, is there some variable I can check in my .tpl file to see which category or subcategory I'm in?

    I'm building out a custom composer that changes based on where the topic is being posted. For instance, it would know that I'm currently in the "NodeBB Plugins" category and display a particular part of my .tpl file, otherwise it wouldn't.

  • 4 Votes
    9 Posts
    3k Views

    Cool stuff 😉

  • 3 Votes
    39 Posts
    20k Views

    Updated with package info to be visible in 0.8.x. Sorry about that oversight! 🍺