Skip to content

Adjusting the size of boxes in posts-list class

Solved Customisation
  • Hi @phenomlab ,

    In NodeBB, there are many pages containing a list of posts such as bookmarks, upvoted, etc.

    For example:
    https://sudonix.com/user/crazycells/upvoted

    How can I change the height of the boxes containing the post with CSS? I would like to increase the box size, so a bigger part of the post will show as a preview in those lists…

    All those lists contain “posts-list” class…

  • @crazycells It’s not so much the height of the boxes that causes the issue here, but more the CSS class overflow: hidden;. You could change that to the below

    .posts-list .posts-list-item .content {
        overflow: auto;
    }
    

    This would then give you something like this

    9d3f213c-f4b7-4795-b7de-99689fd07ed4-image.png

    Notice the scrollbar that appears meaning you scan keep the same panel height, but still scroll through the message to be able to read all of it.

    If you wanted the panel height to size with the content, you’d need to do this

    .posts-list .posts-list-item .content {
        max-height: none;
        height: auto;
    }
    

    Which in turn would result in this

    569b9c79-eadc-4eb2-ae3b-d612b401f010-image.png

    I’d personally take the overflow: auto; route as this is easier on the eyes. However, you get a balance of the two by setting a higher value for max-height , so

    .posts-list .posts-list-item .content {
        max-height: 600px;
    }
    

    This would still require overflow: auto;, but by setting max-height you are able to increase the height of the panel to something more aligned with your requirements, and still be able to read the entire message without having to open it.

    c3ad820c-0cc3-4fee-b099-4cc3466959ce-image.png

    The block of HTML being targeted here is below

    1358ca2c-4d07-4314-bf0c-8ccd1b322941-image.png

  • @phenomlab thanks a lot, this combination works best 👍

    .posts-list .posts-list-item .content {
        overflow: auto;
        max-height: 600px;
    }
    
  • crazycellsundefined crazycells has marked this topic as solved on

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 💗

Related Topics
  • Following the API docs but its not clear ...

    Solved Customisation
    8
    2 Votes
    8 Posts
    518 Views

    @Panda you’d be surprised. If you consider that you’d need to use the API to be able to populate a WordPress widget for example (which in turn would of course be PHP), taking this route is still immensely popular.

  • 1 Votes
    1 Posts
    342 Views
    No one has replied
  • 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 🙂

  • Custom badges

    Solved Customisation
    103
    49 Votes
    103 Posts
    11k Views

    Perfect 😉

  • Gettin Erors NodeBB

    Solved Configure
    7
    0 Votes
    7 Posts
    447 Views

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

  • Top Ranked Forums

    Chitchat
    9
    3 Votes
    9 Posts
    583 Views

    The real issue here is that most people consider forums to be “dead” in the sense that nobody uses them anymore, and social media groups have taken their place. Their once dominant stance in the 90’s and early 00’s will never be experienced again, but having said that, there are a number of forums that did in fact survive the social media onslaught, and still enjoy a large user base.

    Forums tend to be niche. One that immediately sticks out is Reddit - despite looking like it was designed in the 80s, it still has an enormous user base. Another is Stack Overflow, which needs no introduction. The key to any forum is the content it offers, and the more people whom contribute in terms of posting , the more popular and widely respected it becomes as a reliable source of information.

    Forums are still intensely popular with gamers, alongside those that offer tips on hacking etc.

  • Forum Statistics Box

    Solved Customisation
    5
    4 Votes
    5 Posts
    482 Views

    @Sampo2910 said in Forum Statistics Box:

    Say i wanted new theme for example or again something like this?

    Yes, exactly the same process.

  • [NodeBB] First post customization

    Solved Customisation
    5
    4 Votes
    5 Posts
    724 Views

    @phenomlab thanks 🙏