Skip to content

Custom badges

Solved Customisation
  • Hello

    I have added a badge for admin group users, my code works good :

    aa131901-b6b8-4b2f-a180-c385a156d70e-image.png

    but I have this bug when users with this badge provide a solution to an answer. (Quesntion and answer plugin)

    An idea ?

    here my code :

    /*----------------------------------------------------------------------------*/
    /*------------------      Admin members custom badge     ---------------------*/
    /*----------------------------------------------------------------------------*/
    
    /* On avatar */
    
    li[component="post"] a[href*="/groups/administrators"] span.badge-text.align-text-bottom {
        display: none !important;
    }
    
    li[component=post] a[href*="/groups/administrators"] {
        position: absolute !important;
        top: 25px;
        left: 7px;
        z-index: 2;
        margin-top: 1px;
        border-radius: 999px !important;
        line-height: 14px;
        display: block;
        height: auto;
        margin-left: 0px !important;
        background: var(--bs-user-level-bg) !important;
        color: var(--bs-body-color-primary) !important;
        padding-left: 6px !important;
        width: auto;
    }
    
    /* Display icon  */
    li[component=post] a[href*="/groups/administrators"] .fa.fa-crown.me-1 {
        border-radius: 999px !important;
        margin-left: 0px !important;
        margin-top: 3px !important;
    }
    
    /* Disabled on Smartphone */
    @media (max-width: 767px) {
        li[component="post"] a[href*="/groups/administrators"].badge {
                display: none !important;
            }
    }
    
  • @DownPW Try something like

    li[component=post].isSolved a[href*="/groups/administrators"] {
        top: 52px;
    }
    
  • Perfect 😉


Did this solution help you?
Did you find the suggested solution useful? Why not buy me a coffee? It's a nice gesture, and a great way to show your appreciation 💗

  • 3 Votes
    12 Posts
    212 Views

    @crazycells ah, I see. That makes sense.

  • 1 Votes
    5 Posts
    562 Views

    @DownPW very useful tip. Thanks

  • restarting nodebb on boot

    Unsolved Configure
    3
    1 Votes
    3 Posts
    219 Views

    @eeeee said in restarting nodebb on boot:

    can I just run nodebb under nodemon for auto restarts?

    It’s a better method. Nodemon just looks for file system changes and would effectively die if the server was rebooted meaning you’d have to start it again anyway. Systemd is the defacto standard which is how the operating system interacts in terms of services, scheduled tasks etc.

  • 1 Votes
    2 Posts
    264 Views

    @Sala This should look better

    .sidenav .navbar-brand { padding-top: 0.5rem; padding-bottom: 0.5rem; }

    e5cec20e-be36-4ee8-9129-fd11ad4656ac-image.png

    You can increase the top and bottom padding by increasing the values above.

  • 13 Votes
    21 Posts
    2k Views

    @pobojmoks that’s easily done by modifying the code provided here so that it targets background rather than border

    In essence, the below should work

    $(document).ready(function() { $(window).on('action:ajaxify.end', function(data) { $('.recent-card-container').each(function(i) { var dataId = $(this).attr("data-cid"); var color = $('[role="presentation"]', this).css("background-color"); console.log("data-cid " + dataId + " is " + color); $('[data-cid="' + dataId + '"] .recent-card').attr("style", "background-color: " + color); }); }); });
  • 3 Votes
    12 Posts
    981 Views

    @cagatay you’ll need to define this in the body tag (or another element if you want greater or more granular targets) - for example

    body { font-family: "Poppins"; font-size: 16px; }

    Essentially, you use the font-size CSS directive.

  • nodebb dropdown menu

    Solved Configure
    5
    0 Votes
    5 Posts
    428 Views

    @phenomlab said in nodebb dropdown menu:

    @kurulumu-net You set it like the below example taken from this site

    aae36790-3257-4bb2-ad5a-0d744309876a-image.png

    Which presents this

    77f47260-2941-4afe-9614-8e17dcfc8c19-image.png

    Very interesting…

    I actually thought this wasn’t possible, as I remember it being asked in the NodeBB forum.

    Is this something new that’s been implemented? I’ll 100% be doing that when I’m on the laptop over the weekend.

  • nodebb-plugin-customize error

    Solved Customisation
    25
    2 Votes
    25 Posts
    2k Views

    @phenomlab it work, thanks 🙂