Skip to content

Custom badges

Solved Customisation
103 4 25.6k 2
  • @cagatay These

    .self-post a[href*="/groups/verified"] .group-label {
        position: absolute !important;
        right: 51px;
        top: 44px;
    }
    .topic-response-post a[href*="/groups/verified"] .group-label {
        position: absolute !important;
        left: 20px;
        top: 44px;
    }
    .topic-response-post i[component="user/status"] {
        position: absolute;
        left: -1px;
    }
    

    @phenomlab its not work, nothing changed when i deleted those css.

  • @phenomlab its not work, nothing changed when i deleted those css.

    @cagatay what isn’t working?

  • @cagatay what isn’t working?

    @phenomlab there is no changes after deleted css code;

    60f4bfa0-cc9e-4815-8044-9c38fb58769b-image.png

  • @cagatay what isn’t working?

    @phenomlab how can i set blue tick like sudonix to my own? coz codes which you are shared, it not look like yours;

    06a99cc4-2894-4284-84c5-cca50d0119cc-image.png

  • @phenomlab how can i set blue tick like sudonix to my own? coz codes which you are shared, it not look like yours;

    06a99cc4-2894-4284-84c5-cca50d0119cc-image.png

  • phenomlabundefined phenomlab referenced this topic on
  • @phenomlab i read it and did it what you wrote. but result as below;

    42761f89-4153-4945-967a-10afddf478fc-image.png

    blue icon not seen, it hide by avatar 🙂

  • @phenomlab i read it and did it what you wrote. but result as below;

    42761f89-4153-4945-967a-10afddf478fc-image.png

    blue icon not seen, it hide by avatar 🙂

    @cagatay Yes, having checked, I see what you mean. I’ve fixed this on your site.

    This is the new applied code

    .post-header a[href*="/groups/onaylı-üyeler"] {
        margin-right: 3px;
        margin-top: 1px;
        border-radius: 50%;
        line-height: 20px;
        display: inline-block;
        vertical-align: middle;
        text-align: center;
        overflow: hidden;
    }
    small.label.group-label.inline-block i {
        margin-top: 1px;
        margin-left: 0px;
        vertical-align: middle;
        justify-content: center;
        display: flex;
    }
    .post-header a[href*="/groups/onaylı-üyeler"] .group-label {
        min-width: 20px;
        display: flex;
        justify-content: center;
    }
    .self-post a[href*="/groups/onaylı-üyeler"] .group-label {
        position: absolute !important;
        right: 51px;
        top: 44px;
        z-index: 2;
    }
    .topic-response-post a[href*="/groups/onaylı-üyeler"] .group-label {
        position: absolute !important;
        left: 20px;
        top: 44px;
        z-index: 2;
    }
    .topic-response-post i[component="user/status"] {
        position: absolute;
        left: -1px;
    }
    .group-label {
        vertical-align: -6px;
    }
    

    However, there were some errors on your part. You were correct in renaming the actual group in CSS (good call) because of the language not being English, but the path was incorrect. You used the below, which was customized for @crazycells install 🙂

    /forum/groups/onaylı-üyeler
    

    It should be

    /groups/onaylı-üyeler
    

    You also have some overriding CSS somewhere that defines a lower z-index value which forces the “verified” icon behind the avatar, so I’ve added an adjustment for that

    z-index: 2;
    
  • @cagatay Yes, having checked, I see what you mean. I’ve fixed this on your site.

    This is the new applied code

    .post-header a[href*="/groups/onaylı-üyeler"] {
        margin-right: 3px;
        margin-top: 1px;
        border-radius: 50%;
        line-height: 20px;
        display: inline-block;
        vertical-align: middle;
        text-align: center;
        overflow: hidden;
    }
    small.label.group-label.inline-block i {
        margin-top: 1px;
        margin-left: 0px;
        vertical-align: middle;
        justify-content: center;
        display: flex;
    }
    .post-header a[href*="/groups/onaylı-üyeler"] .group-label {
        min-width: 20px;
        display: flex;
        justify-content: center;
    }
    .self-post a[href*="/groups/onaylı-üyeler"] .group-label {
        position: absolute !important;
        right: 51px;
        top: 44px;
        z-index: 2;
    }
    .topic-response-post a[href*="/groups/onaylı-üyeler"] .group-label {
        position: absolute !important;
        left: 20px;
        top: 44px;
        z-index: 2;
    }
    .topic-response-post i[component="user/status"] {
        position: absolute;
        left: -1px;
    }
    .group-label {
        vertical-align: -6px;
    }
    

    However, there were some errors on your part. You were correct in renaming the actual group in CSS (good call) because of the language not being English, but the path was incorrect. You used the below, which was customized for @crazycells install 🙂

    /forum/groups/onaylı-üyeler
    

    It should be

    /groups/onaylı-üyeler
    

    You also have some overriding CSS somewhere that defines a lower z-index value which forces the “verified” icon behind the avatar, so I’ve added an adjustment for that

    z-index: 2;
    

    @phenomlab ah okey Mark 🙂 you as always better then me so there is no word in my side for the explaniton 🙂

    thank you again.

  • @phenomlab ah okey Mark 🙂 you as always better then me so there is no word in my side for the explaniton 🙂

    thank you again.

    @cagatay said in Custom badges:

    @phenomlab ah okey Mark 🙂 you as always better then me so there is no word in my side for the explaniton 🙂

    thank you again.

    hi @cagatay , as a first step you have to create a group called “verified” , then everything is as it is written on this thread… but since your group name was different, it gave an error…

    I am writing this explicitly so that others can be aware.

  • @cagatay said in Custom badges:

    @phenomlab ah okey Mark 🙂 you as always better then me so there is no word in my side for the explaniton 🙂

    thank you again.

    hi @cagatay , as a first step you have to create a group called “verified” , then everything is as it is written on this thread… but since your group name was different, it gave an error…

    I am writing this explicitly so that others can be aware.

    @crazycells said in Custom badges:

    I am writing this explicitly so that others can be aware.

    Good point. Thanks

  • @crazycells said in Custom badges:

    I am writing this explicitly so that others can be aware.

    Good point. Thanks

    @phenomlab i have problem with my badges for ios and android users.

    i can secret all of from mobile users?

  • @phenomlab i have problem with my badges for ios and android users.

    i can secret all of from mobile users?

    @cagatay Are they showing on mobile ? Can you send a screenshot ?

  • @cagatay Are they showing on mobile ? Can you send a screenshot ?

    @phenomlab sure,

    58aec53e-de00-4dee-a113-37f74ccbf338-image.png

  • @cagatay Do you want the icon to show? Because of the size of the screen estate, I think it makes more sense to hide it?

  • @cagatay Do you want the icon to show? Because of the size of the screen estate, I think it makes more sense to hide it?

    @phenomlab i want to hide them.

  • @phenomlab i want to hide them.

    @cagatay Add this to your custom CSS

    @media (max-width: 767px) {
         .post-header a[href*="/groups/onaylı-üyeler"] {
             display: none;
        }
    }
    
    
  • @cagatay Add this to your custom CSS

    @media (max-width: 767px) {
         .post-header a[href*="/groups/onaylı-üyeler"] {
             display: none;
        }
    }
    
    

    @phenomlab same problem here 🙂

    972c895e-6e96-480c-9a65-dda57ac1c3d3-image.png

    PS: i’m using chrome

  • @phenomlab same problem here 🙂

    972c895e-6e96-480c-9a65-dda57ac1c3d3-image.png

    PS: i’m using chrome

    @cagatay Already fixed. Thanks.

    This seems to have become an issue in the most recent update from NodeBB.

  • hi @phenomlab , I have made some updates to the CSS elements, and right now it looks like a badge with a wavy edge…

    Screen Shot 2023-05-29 at 14.25.21.png

    
    .post-header a[href*="/forum/groups/verified"] {
        margin-right: 3px;
        margin-top: 1px;
        border-radius: 50%;
        line-height: 20px;
        display: inline-block;
        vertical-align: middle;
        overflow: hidden;
        position: relative;
    }
    
    .post-header a[href*="/forum/groups/verified"]::before {
        content: "\f00c";
        position: absolute;
        z-index: 1; /* Added z-index to bring it to the front */
        width: 20px;
        height: 20px;
        background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' stroke-width='1.5' viewBox='0 0 24 24' fill='%23085EAC'%3E%3Cpath d='M10.5213 2.62368C11.3147 1.75255 12.6853 1.75255 13.4787 2.62368L14.4989 3.74391C14.8998 4.18418 15.4761 4.42288 16.071 4.39508L17.5845 4.32435C18.7614 4.26934 19.7307 5.23857 19.6757 6.41554L19.6049 7.92905C19.5771 8.52388 19.8158 9.10016 20.2561 9.50111L21.3763 10.5213C22.2475 11.3147 22.2475 12.6853 21.3763 13.4787L20.2561 14.4989C19.8158 14.8998 19.5771 15.4761 19.6049 16.071L19.6757 17.5845C19.7307 18.7614 18.7614 19.7307 17.5845 19.6757L16.071 19.6049C15.4761 19.5771 14.8998 19.8158 14.4989 20.2561L13.4787 21.3763C12.6853 22.2475 11.3147 22.2475 10.5213 21.3763L9.50111 20.2561C9.10016 19.8158 8.52388 19.5771 7.92905 19.6049L6.41553 19.6757C5.23857 19.7307 4.26934 18.7614 4.32435 17.5845L4.39508 16.071C4.42288 15.4761 4.18418 14.8998 3.74391 14.4989L2.62368 13.4787C1.75255 12.6853 1.75255 11.3147 2.62368 10.5213L3.74391 9.50111C4.18418 9.10016 4.42288 8.52388 4.39508 7.92905L4.32435 6.41553C4.26934 5.23857 5.23857 4.26934 6.41554 4.32435L7.92905 4.39508C8.52388 4.42288 9.10016 4.18418 9.50111 3.74391L10.5213 2.62368Z' stroke='none'/%3E%3C/svg%3E");
        background-size: cover;
        color: #ffffff; /* Added to set the color of the checkmark */
        font-family: "Font Awesome 5 Free";
        font-weight: 900;
        font-size:8px;
        text-align: center;
        line-height: 20px;
    }
    small.label.group-label.inline-block i {
        margin-top: 1px;
        margin-left: 0px;
        vertical-align: middle;
        justify-content: center;
        display: flex;
    }
    .post-header a[href*="/forum/groups/verified"] .group-label {
        min-width: 20px;
        display: flex;
        justify-content: center;
        background-color: transparent !important;
    }
    .group-label {
        vertical-align: -6px;
    }
    
    

    This is achieved thanks to ChatGPT… the code specifically uses this “#085EAC” color… it can of course be changed…

  • hi @phenomlab , I have made some updates to the CSS elements, and right now it looks like a badge with a wavy edge…

    Screen Shot 2023-05-29 at 14.25.21.png

    
    .post-header a[href*="/forum/groups/verified"] {
        margin-right: 3px;
        margin-top: 1px;
        border-radius: 50%;
        line-height: 20px;
        display: inline-block;
        vertical-align: middle;
        overflow: hidden;
        position: relative;
    }
    
    .post-header a[href*="/forum/groups/verified"]::before {
        content: "\f00c";
        position: absolute;
        z-index: 1; /* Added z-index to bring it to the front */
        width: 20px;
        height: 20px;
        background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' stroke-width='1.5' viewBox='0 0 24 24' fill='%23085EAC'%3E%3Cpath d='M10.5213 2.62368C11.3147 1.75255 12.6853 1.75255 13.4787 2.62368L14.4989 3.74391C14.8998 4.18418 15.4761 4.42288 16.071 4.39508L17.5845 4.32435C18.7614 4.26934 19.7307 5.23857 19.6757 6.41554L19.6049 7.92905C19.5771 8.52388 19.8158 9.10016 20.2561 9.50111L21.3763 10.5213C22.2475 11.3147 22.2475 12.6853 21.3763 13.4787L20.2561 14.4989C19.8158 14.8998 19.5771 15.4761 19.6049 16.071L19.6757 17.5845C19.7307 18.7614 18.7614 19.7307 17.5845 19.6757L16.071 19.6049C15.4761 19.5771 14.8998 19.8158 14.4989 20.2561L13.4787 21.3763C12.6853 22.2475 11.3147 22.2475 10.5213 21.3763L9.50111 20.2561C9.10016 19.8158 8.52388 19.5771 7.92905 19.6049L6.41553 19.6757C5.23857 19.7307 4.26934 18.7614 4.32435 17.5845L4.39508 16.071C4.42288 15.4761 4.18418 14.8998 3.74391 14.4989L2.62368 13.4787C1.75255 12.6853 1.75255 11.3147 2.62368 10.5213L3.74391 9.50111C4.18418 9.10016 4.42288 8.52388 4.39508 7.92905L4.32435 6.41553C4.26934 5.23857 5.23857 4.26934 6.41554 4.32435L7.92905 4.39508C8.52388 4.42288 9.10016 4.18418 9.50111 3.74391L10.5213 2.62368Z' stroke='none'/%3E%3C/svg%3E");
        background-size: cover;
        color: #ffffff; /* Added to set the color of the checkmark */
        font-family: "Font Awesome 5 Free";
        font-weight: 900;
        font-size:8px;
        text-align: center;
        line-height: 20px;
    }
    small.label.group-label.inline-block i {
        margin-top: 1px;
        margin-left: 0px;
        vertical-align: middle;
        justify-content: center;
        display: flex;
    }
    .post-header a[href*="/forum/groups/verified"] .group-label {
        min-width: 20px;
        display: flex;
        justify-content: center;
        background-color: transparent !important;
    }
    .group-label {
        vertical-align: -6px;
    }
    
    

    This is achieved thanks to ChatGPT… the code specifically uses this “#085EAC” color… it can of course be changed…

    @crazycells oooohhhhh - I like!!!


Did this solution help you?
Did you find the suggested solution useful? Support 💗 Sudonix with a coffee
If your organisation needs deeper expertise around infrastructure, security, or technology leadership, learn more about Phenomlab Ltd. Many of the deeper technical guides behind Sudonix are published there.

Related Topics
  • 2 Votes
    94 Posts
    12k Views
    @willi@social.tchncs.de a VPS can be had from DigitalOcean or Vultr quite economically (although I know that isn’t always the case in some countries) You can also use our referral link for an account credit too!
  • how to hide "moved" badge with CSS?

    Solved Customisation nodebb
    12
    1
    3 Votes
    12 Posts
    2k Views
    @crazycells ah, I see. That makes sense.
  • What is this bar called?

    Solved Customisation nodebb
    92
    1
    36 Votes
    92 Posts
    21k Views
    This is good
  • Plugin reaction Bug

    Solved Customisation plugin nodebb reaction
    15
    1
    0 Votes
    15 Posts
    3k Views
    @DownPW That was going to be my next suggestion
  • 0 Votes
    5 Posts
    1k Views
    @qwinter this particular site uses the code I wrote if you want to see it in action. It’s a information and intelligence gatherer I designed for collecting various information security articles from around the globe and consolidating them in one place. Essentially, each “post” is in fact generated by the script, and the NodeBB API. https://hostrisk.com/
  • is "night mode" shifting the forum several pixels up?

    Solved Configure nodebb
    8
    4 Votes
    8 Posts
    1k Views
    @crazycells hmm. Good point. I actually use my own version of the dark mode plugin, so not entirely sure. However, I think the CSS is probably the same. I’m not at my PC currently but can check and advise later.
  • [NODEBB] Help for my custom CSS

    Solved Customisation nodebb css bugfix
    237
    49 Votes
    237 Posts
    80k Views
    @baris said: You should change your selectors so it doesn’t look at the entire document. You probably only want to apply fancybox to stuff inside the #content element which is what changes when the user navigates around the page. So use $('#content a').... for your selectors then the forum logo in the header won’t be selected. I modified the JS Fancybox code now and this code and it seem better // --------------------------------------------- // Fancybox Media Reader (Without Website Logo) // --------------------------------------------- if (top.location.pathname !== '/login') { $(window).on('action:posts.loaded', function(data) { console.log("Polling DOM for lazyLoaded images to apply Fancybox"); $(document).ready(function() { $('#content a').not('.forum-logo').not(".avatar").not(".emoji").not(".bmac-noanimate").each(function() { $('#content a[href*=".jpg"], #content a[href*=".jpeg"], #content a[href*=".png"], #content a[href*=".gif"], #content a[href*=".webp"]').addClass("noanimate"); }); }); }); } if (top.location.pathname !== '/login') { $(document).ready(function() { $(window).on('action:ajaxify.end', function(data) { $('#content a').not('.logo').not(".avatar").not(".emoji").not(".bmac-noanimate").each(function() { $('#content a[href*=".jpg"], #content a[href*=".jpeg"], #content a[href*=".png"], #content a[href*=".gif"], #content a[href*=".webp"]').addClass("noanimate"); data.preventDefault() // Strip out the images contained inside blockquotes as this looks nasty :) $('#content blockquote img').remove(); }); Fancybox.bind( '#content a[href*=".jpg"], #content a[href*=".jpeg"], #content a[href*=".png"], #content a[href*=".gif"], #content a[href*=".webp"]', { groupAll: true, } ); }); }); } // Chat fancybox - fires when chat module loaded and AJAX calls new chat $(document).ready(function() { $(window).on('action:chat.loaded', function(data) { // >>> Se limiter au contenu principal uniquement <<< $('#content img').not('.forum-logo').not(".avatar").not(".emoji").not(".bmac-noanimate").each(function() { var newHref = $(this).attr("src"); $(this).wrap("<a class='fancybox' href='" + newHref + "'/>"); $('#content a[href*=".jpg"], #content a[href*=".jpeg"], #content a[href*=".png"], #content a[href*=".gif"], #content a[href*=".webp"]').addClass("noanimate"); data.preventDefault(); // Strip out the images contained inside blockquotes as this looks nasty :) $('#content blockquote img').remove(); }); Fancybox.bind( '#content a[href*=".jpg"], #content a[href*=".jpeg"], #content a[href*=".png"], #content a[href*=".gif"], #content a[href*=".webp"]', { groupAll: true, } ); }); }); For the logo, I must use overflow: visible !important; on [component="brand/logo"] /* --- Logo --- */ [component="brand/logo"] { max-height: 50px; width: auto; height: auto; max-width: 100%; display: block; object-fit: contain; object-position: left center; overflow: visible !important; } Better result !!
  • nodebb-plugin-customize error

    Solved Customisation
    25
    2 Votes
    25 Posts
    8k Views
    @phenomlab it work, thanks