• Category For User

    Solved Configure
    11
    12 Votes
    11 Posts
    38 Views

    3.5.1 has now been released. I’ve just deployed it, so safe to do so!

  • 2 Votes
    1 Posts
    121 Views

    One simple feature I wanted in Sudonix was for the border of the first post in a new thread to match the colour set by the category. This makes the first post stand out, and looks nice too 🙂

    The code is based around the same functionality here

    https://sudonix.com/topic/256/recent-cards-plugin-customization

    It’s relatively simple in it’s approach. Here is is

    $(document).ready(function() { $(window).on('action:ajaxify.end', function(data) { var categoryColor = $('[role="presentation"].icon').css("background-color"); $('li.topic-owner-post:nth-child(1)').css('border-color', categoryColor); }); });

    Essentially, this jQuery snippet looks for the role="presentation" attribute in the topic stream (there’s only the one, so no need for any loop to detect all of them like we do in the previous link), grab the CSS value, and then set it as the border so it looks like this

    53ed0377-97d3-4d3b-b445-cb0f46bdd52f-image.png

    All you need to do is copy the snippet, and place this in your ACP -> Appearance -> Custom JS

    Enjoy…