Post Style View

Solved Customisation

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💗

  • 1 Votes
    1 Posts
    42 Views

    I thought I had already created a dedicated thread for this elsewhere, but clearly not - it was probably bundled in with another topic.

    If you want to create an “Author” badge on each post that looks like the below, you can do this using pure CSS

    d983d994-c4b6-4063-ae1e-74bba88d75b5-image.png

    Required CSS

    .topic-owner-post [itemprop=name]:after { border: 2px solid var(--bs-border-color); border-radius: 0.25rem !important; color: var(--bs-body-color); content: "Author"; margin-left: 5px; padding: 2px 10px; display: inline-block; }

    However, things get slightly more complicated if you want to add an icon in the same element, like the below

    a81318a0-a15c-45f1-94f7-ee17a1931433-image.png

    As the above example makes use of the :after pseudo element, it’s not possible to have two font-family statements when using content: ""

    To facilitate this, you’d need a jQuery function that looks like the below

    $(document).ready(function() { $(window).on('action:ajaxify.end', function(data) { $(".topic-owner-post [itemprop=name]").append("<span class='author'><span class='author-icon'><i class='fa-light fa-bullhorn'></i>Author</span>"); }); });

    Here, you use span tags to insert both the icon, and text 🙂

    Obviously, you need to ensure that the css for .author and .author-icon exist.

    Here’s an example

    span.author { border: 2px solid var(--bs-border-color); border-radius: 0.25rem !important; color: var(--bs-body-color); content: "Author"; margin-left: 5px; padding: 2px 10px; display: inline-block; } span.author-icon i { margin-right: 5px; }
  • 36 Votes
    55 Posts
    1k 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 🙂

  • Gettin Erors NodeBB

    Solved Configure
    7
    0 Votes
    7 Posts
    130 Views

    @phenomlab no forum is working goods.
    there is no eror message since yestarday.

  • Fresher in Nodebb install

    General
    24
    15 Votes
    24 Posts
    380 Views

    @Hari I’ve been reading a lot about APO. Looks impressive.

  • 13 Votes
    21 Posts
    1k 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); }); }); });
  • Fontawesome 5

    Unsolved Customisation
    14
    1 Votes
    14 Posts
    314 Views

    @pwsincd hi. Just following up on this thread (I know it’s old) but was curious to understand if it’s still an issue or not ?

  • 7 Votes
    7 Posts
    249 Views

    @phenomlab thank you very much 🙂

  • unable to upvote on forum

    Solved Performance
    10
    3 Votes
    10 Posts
    337 Views

    @phenomlab yes, i can understand. it is working now 🙂