Skip to content

[NodeBB] Custom fields plugin

Unsolved Customisation
  • Hi again , on our sire we require the use of custom user fields so we can refer to them with our own bespoke plugin we are going to develop , however this plugin https://github.com/NicolasSiver/nodebb-plugin-ns-custom-fields fails to function on recent builds of nodeBB i wonder if anyone here has had any success in getting custom fields to work ? some of the code in the default nodebb suggests it is already possible .

    Also this plugin would be more suitable as it suggests registration fields… but likewise it fails https://www.npmjs.com/package/nodebb-plugin-itu-custom-registration-fields

  • @pwsincd This is always a problem with Open Source development in the sense that packages are often suddenly abandoned and no response ever provided to any requests. Does this plugin make NodeBB crash, or does it actually install ?

    I think the only way forward here is to fork and update it for the latest version, which may take some time.

  • @phenomlab it appears to install but has nothing to work on … no admin edits visible etc…

  • @pwsincd On checking this plugin, the install appears to actually fail - see the below from the log

    022-04-01T10:43:11.554Z [4567/513037] - warn:    [plugins/nodebb-plugin-ns-custom-fields] The plugin.json field "library" is deprecated. Please use the package.json field "main" instead.
    2022-04-01T10:43:11.555Z [4567/513037] - warn: [plugins] Unable to load library for: nodebb-plugin-ns-custom-fields
    2022-04-01T10:43:11.555Z [4567/513037] - error: Error: Cannot find module './src/emitter'
    Require stack:
    - /home/sudonix/nodebb/require-main.js
    - /home/sudonix/nodebb/app.js
        at Function.Module._resolveFilename (internal/modules/cjs/loader.js:902:15)
        at Function.Module._load (internal/modules/cjs/loader.js:746:27)
        at Module.require (internal/modules/cjs/loader.js:974:19)
        at require (internal/modules/cjs/helpers.js:101:18)
        at Module.require.main.require (/home/sudonix/nodebb/require-main.js:8:10)
        at /home/sudonix/nodebb/node_modules/nodebb-plugin-ns-custom-fields/plugin/nodebb.js:9:31
        at Object.<anonymous> (/home/sudonix/nodebb/node_modules/nodebb-plugin-ns-custom-fields/plugin/nodebb.js:47:3)
        at Module._compile (internal/modules/cjs/loader.js:1085:14)
        at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
        at Module.load (internal/modules/cjs/loader.js:950:32)
    
  • @pwsincd hi. Just following up on this thread (I know it’s old) but was curious to understand if it’s still an issue or not ?


  • 13 Votes
    30 Posts
    1k Views

    Here’s a small modification to the chatBanner function that will place the message just above the composer/reply component meaning it is pinned at the bottom and always in view as a reminder. I’ve made this change to support the threadedChat I’m currently developing

    // Chat message banner function chatBanner() { var roomName = $("h5[component='chat/header/title']").text().trim(); var bannerContent; if (roomName === "Testing 3") { bannerContent = '<div id="chatbanner">This message will fire for chat rooms with the title of "Testing 3"</div>'; } else { bannerContent = '<div id="chatbanner">This session is for <strong>private discussion only</strong> between the chosen participants. Please do <strong>not</strong> place support requests here and create a <a href="#" onclick="app.newTopic();">new topic</a> instead.</div>'; } var chatMessagesContainer = $('[component="chat/system-message"]:last-of-type'); //var existingMessages = $('[component="chat/message"]'); var existingMessages = $('[component="chat/composer"]'); if (existingMessages.length === 0) { // If there are no messages, append the banner to the messages container chatMessagesContainer.first().after(bannerContent); } else { // If there are messages, add the banner after the last message // existingMessages.last().after(bannerContent); existingMessages.before(bannerContent); } }

    There are only two changes here:

    var existingMessages = $('[component="chat/message"]');

    becomes

    var existingMessages = $('[component="chat/composer"]');

    and

    existingMessages.last().after(bannerContent);

    becomes

    existingMessages.before(bannerContent);
  • 6 Votes
    15 Posts
    695 Views

    No no, I said that in the sense that he told me it was simple ^^
    I was able to see that this was not the case by targeting the elements he had advised me.

  • 0 Votes
    2 Posts
    456 Views

    @mventures said in NodeBB: Consent policy popup:

    How did you implement this consent pop-up?

    This is located in /admin/settings/cookies

    @mventures said in NodeBB: Consent policy popup:

    Does it appear every new day for a user who has accepted it?

    No. It places a cookie on the machine of the user who visits the site, and once they accept it, it doesn’t appear again unless you select

    0bda6e07-efca-4039-a132-c94060a6fec4-image.png

  • 0 Votes
    4 Posts
    524 Views

    @cagatay You’d target the body tag and use the below line of CSS

    background: url(/assets/customcss/backgrounds/default/default.png) no-repeat center center fixed;

    Obviously, you need to change the path to suit where your image is being stored.

    More info around the background property can be found here

    https://www.w3schools.com/cssref/css3_pr_background.php

  • 0 Votes
    7 Posts
    412 Views

    @DownPW not sure what you mean. Can you elaborate ?

  • 5 Votes
    29 Posts
    2k Views

    @phenomlab said in nodebb chat roll dice game:

    @DownPW I still think you could do something much quicker with jQuery.

    Why not but like I said, I have no skills to do that.

    If you are motivated, why not but I don’t want to bother you especially since it will only be for a certain period of time.

  • [NodeBB] username cards

    Solved Customisation
    8
    5 Votes
    8 Posts
    826 Views

    @phenomlab

    Aha…nice to know. As always thank you for the reply and information.

  • 0 Votes
    3 Posts
    678 Views

    @phenomlab many thanks Mark 😁.