Skip to content

Forum customisation

Customisation
  • Hi Mark,

    I’d like some help customising two forums running NodeBB please if possible.

    I wish to change the colours of the buttons below.

    1000005618.png

    And how can I change the board stats widget to look similar to this…

    1000005620.png

    As always, thank you! 🤝.

  • phenomlabundefined phenomlab marked this topic as a regular topic on
  • @JAC said in Forum customisation:

    I wish to change the colours of the buttons below.

    .link-primary, .text-primary {
        color: var(--bs-link-color) !important;
    }
    

    @JAC said in Forum customisation:

    And how can I change the board stats widget to look similar to this…

    .border-secondary {
        --bs-border-opacity: 1;
        border-color: var(--bs-border-color) !important;
        border-radius: 10px !important;
    }
    
    [component="widget/board-stats"] .text-bg-secondary:first-child {
        color: var(--bs-link-color) !important;
        background-color: var(--bs-node-card-cap-bg) !important;
        border-top-left-radius: 10px !important;
        border-top-right-radius: 10px !important;
    }
    
    [component="widget/board-stats"] .text-bg-secondary {
        color: var(--bs-link-color) !important;
        background-color: var(--bs-node-card-cap-bg) !important;
        border-top-left-radius: 0px !important;
        border-top-right-radius: 0px !important;
    }
    
  • Perfect @DownPW, thank you very much!

    I’ll try these on the laptop later.

  • @JAC Worth noting that @DownPW (like myself) uses CSS variables, so if you copy this like for like, it won’t work. You’d need to use actual HEX values for colours etc.

  • @JAC said in Forum customisation:

    I wish to change the colours of the buttons below.

    I’d do this a bit different to @DownPW and be more specific with the target. Obviously, change #ffffff to whatever value you require

    [component="post/actions"] a i, [component="post/actions"] span i {
        color: #ffffff !important;
    }
    

    This should produce something like the below (obviously not the dark background), and not white, but you get the idea.

    65c886f4-27b2-4d0f-a57c-a34a547eb8b1-image.png

    The below CSS should not be used in this instance because it will target several other elements on the site and produce undesirable results

    .link-primary, .text-primary {
        color: var(--bs-link-color) !important;
    }
    

    @JAC said in Forum customisation:

    And how can I change the board stats widget to look similar to this…

    I’d use something like this, which will target the widget background and the colour of the text in use

    [component="widget/board-stats"] {
        background: #000000;
        color: #ffffff;
    }
    

    And the below, which will target the background and text colour of the header

    [component="widget/board-stats"] h3 {
        background: red !important;
        color: yellow !important;
    }
    

    So the actual CSS you need is

    [component="widget/board-stats"] {
        background: #194F90;
        color: #ffffff;
    }
    [component="widget/board-stats"] h3 {
        background: #000000 !important;
    }
    .widget-board-stats.border.border-secondary a {
        color: #FFC557;
    }
    

    This should produce

    bc4fd490-b000-4052-a929-35b6a8be4ba8-image.png

  • Thanks very much for all the guidance, I’m currently away and don’t have the laptop on me so I’ll get to these changes next week.

  • I’m yet to add the above changes however I need to make further customisations to the look and feel of my forum if possible.

    I’d like to add a box at the bottom of the last reply which will display something like ‘login/sign up to reply’. The only problem is it could get quite annoying for people already logged in if the message shows.

    1000009673.png

    And if possible a border around the quotation bubble if possible?

    1000009671.png

    Thanks as always for all the continued help.

  • @JAC said in Forum customisation:

    The only problem is it could get quite annoying for people already logged in if the message shows

    This won’t be an issue. We can set it so that it only fires for those visitors who aren’t logged in

    @JAC said in Forum customisation:

    And if possible a border around the quotation bubble if possible?

    Certainly possible although the border natively won’t cover the callout shape.

  • @phenomlab said in Forum customisation:

    This won’t be an issue. We can set it so that it only fires for those visitors who aren’t logged in

    That sounds perfect!!

    @phenomlab said in Forum customisation:

    Certainly possible although the border natively won’t cover the callout shape.

    That’s fine, what about just having the background of the quote blue with white writing and the @username in yellow?

    Also I’ve noticed the newest post displays this line, is that fixable to show something like a border around the newest message or something similar? 🤔

    1000009675.png

  • @JAC said in Forum customisation:

    That’s fine, what about just having the background of the quote blue with white writing and the @username in yellow?

    Something like this? (these are live on your site now)

    8bd7399a-58bf-4052-8ab5-00ca63548df9-image.png

    @JAC said in Forum customisation:

    Also I’ve noticed the newest post displays this line, is that fixable to show something like a border around the newest message or something similar?

    Yes, that’s the current post or last post marker. On a desktop, it’s easy to see, and there’s a decent amount of space between the border and the post as you can see from the screenshot. On mobile however, the view is condensed, so it looks like this

    5c863753-b5a7-4bf9-958e-e595d7694da0-image.png

    The way to fix that and make it a bit more elegant is to use padding left and right (10px), so

    @media (max-width: 575.98px) {
        body.template-topic .topic .posts.timeline [component=post] {
            margin-left: initial;
            padding-left: 10px;
            padding-right: 10px !important;
        }
    }
    

    Which gives you this

    d22c20cd-ebd7-4feb-8ebb-2e20867106a3-image.png

    Also live on the forum now.

  • Thank you Mark, the changes look fantastic!!


Related Topics
  • Who uses Flarum?

    Chitchat
    22
    7 Votes
    22 Posts
    389 Views

    @Madchatthew I use it here. It is faster, but not sure if that extends to build times.

  • TNG + Nodebb

    General
    4
    0 Votes
    4 Posts
    142 Views

    @Madchatthew said in TNG + Nodebb:

    you have to try and use duck tape and super glue to change something to make it do what you want it to do

    I couldn’t have put that better myself.

  • Nodebb design

    Solved General
    2
    1 Votes
    2 Posts
    292 Views

    @Panda said in Nodebb design:

    One negative is not being so good for SEO as more Server side rendered forums, if web crawlers dont run the JS to read the forum.

    From recollection, Google and Bing have the capability to read and process JS, although it’s not in the same manner as a physical person will consume content on a page. It will be seen as plain text, but will be indexed. However, it’s important to note that Yandex and Baidu will not render JS, although seeing as Google has a 90% share of the content available on the web in terms of indexing, this isn’t something you’ll likely lose sleep over.

    @Panda said in Nodebb design:

    The “write api” is preferred for server-to-server interactions.

    This is mostly based around overall security - you won’t typically want a client machine changing database elements or altering data. This is why you have “client-side” which could be DOM manipulation etc, and “server-side” which performs more complex operations as it can communicate directly with the database whereas the client cannot (and if it can, then you have a serious security flaw). Reading from the API is perfectly acceptable on the client-side, but not being able to write.

    A paradigm here would be something like SNMP. This protocol exists as a UDP (UDP is very efficient, as it is “fire and forget” and does not wait for a response like TCP does) based service which reads performance data from a remote source, thus enabling an application to parse that data for use in a monitoring application. In all cases, SNMP access should be “RO” (Read Only) and not RW (Read Write). It is completely feasible to assume complete control over a firewall for example by having RW access to SNMP and then exposing it to the entire internet with a weak passphrase.

    You wouldn’t do it (at least, I hope you wouldn’t) and the same ethic applies to server-side rendering and the execution of commands.

  • Removing blue 'moved' tag from post

    Solved Configure
    16
    3 Votes
    16 Posts
    737 Views

    @phenomlab
    Ah, got it working!
    I reversed the CSS addition to put z index high, and then I could see another error box saying fork title must be at least 3 characters.
    So made the new fork title longer and button responded.

  • 36 Votes
    55 Posts
    5k Views

    @DownPW I see why. The code relies on the existence of

    [component="topic/quickreply/container"]

    However, this by definition means that the below has to be enabled

    aeef638f-4188-489d-a9f2-f3a26dbca9d8-image.png

    It will then work

    7fb38631-e0f3-46ef-b652-00929d927b13-image.png

    For some unknown reason, this is hidden in Harmony, and only shows if you select it. In v2, it seems that the <section> is deleted altogether in Persona if “Quick Reply” is disabled, meaning it won’t fire as it can’t locate that specific component.

    The downside is that you might not want the quick reply function, but I think it’s a PITA to scroll up to the top of the post just to reply, so I have it on 🙂

  • Forum Icons NodeBB

    Solved Customisation
    13
    0 Votes
    13 Posts
    1k Views

    @cagatay That matches what I see

    4f0f858d-9812-42b1-9f61-ffb13d31dccd-image.png

  • creating topic specific widgets

    Solved Customisation
    16
    10 Votes
    16 Posts
    1k Views

    @crazycells said in creating topic specific widgets:

    Additionally if hide class exists, why are we re-defining it?

    We’re not 🤭 I misspelled it - it should be hidden

  • Customising NodeBB

    Locked Customisation
    3
    0 Votes
    3 Posts
    750 Views

    Closing this thread as a duplicate of https://sudonix.com/topic/12/nodebb-customisation