Skip to content

Extended functions for Q&A NodeBB plugin

Let's Build It
  • I wanted to add functionality into Sudonix so that it

    a) Adds a new DIV in the form of a panel/card after the last post if the topic is “solved”
    b) Adds a link that will take you straight to the solution
    c) Scrolls to that particular DIV containing the solution using page scrolling with an offset

    Basically, it would look like this - see video below:

    To my mind, this is a nice touch - a key feature that is missing from the Q&A plugin. I’ve asked for it to be added, although I’m not sure how much of an appetite there is for this, so with some simple HTML, NodeBB Widget areas, and some jQuery, it’s all possible 🙂

    Widget code below:

    https://github.com/phenomlab/nodebb-q-a-extension/blob/main/widget.html

    How to use

    1. Open /admin/extend/widgets
    2. Drag and drop a HTML widget into the topic.tpl template, positioned in the Topic Footer
    3. Paste the code from Github into the HTML pane like below

    36a2f2d0-ed7a-4f94-a5fa-1b742c331413-image.png

    1. Save the changes

    Add this into your custom CSS /admin/appearance/customise#custom-css. Note that this is a “starting point” that uses var and so you will need to adjust to fir your own site.

    https://github.com/phenomlab/nodebb-q-a-extension/blob/main/style.css

    From now, any topics which are enabled for Q&A and set to a question will look something like the below

    Resolved

    ddbf913b-bb9e-401c-8e15-530b6d2a23c0-image.png

    Unresolved

    6ea90947-30e1-4a0e-a4a8-4305267f9d3a-image.png

    Unanswered

    3d16f558-94f7-49bc-84c2-44f0b14e55f6-image.png

    This makes the Q&A plugin a bit more intuitive - what do you think?

  • That looks fantastic Mark 👌🏻🤝.

  • Very good like always 😉


Related Topics