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
  • 3 Votes
    5 Posts
    305 Views

    @crazycells Agreed. It takes a more sensible approach. Nobody ever upvotes the first post - it’s usually much further down as the conversation progresses.

  • SEO and Nodebb

    Performance
    2
    2 Votes
    2 Posts
    292 Views

    @Panda It’s the best it’s ever been to be honest. I’ve used a myriad of systems in the past - most notably, WordPress, and then Flarum (which for SEO, was absolutely dire - they never even had SEO out of the box, and relied on a third party extension to do it), and NodeBB easily fares the best - see below example

    https://www.google.com/search?q=site%3Asudonix.org&oq=site%3Asudonix.org&aqs=chrome..69i57j69i60j69i58j69i60l2.9039j0j3&sourceid=chrome&ie=UTF-8#ip=1

    However, this was not without significant effort on my part once I’d migrated from COM to ORG - see below posts

    https://community.nodebb.org/topic/17286/google-crawl-error-after-site-migration/17?_=1688461250365

    And also

    https://support.google.com/webmasters/thread/221027803?hl=en&msgid=221464164

    It was painful to say the least - as it turns out, there was an issue in NodeBB core that prevented spiders from getting to content, which as far as I understand, is now fixed. SEO in itself is a dark art - a black box that nobody really fully understands, and it’s essentially going to boil down to one thing - “content”.

    Google’s algorithm for indexing has also changed dramatically over the years. They only now crawl content that has value, so if it believes that your site has nothing to offer, it will simply skip it.

  • 1 Votes
    1 Posts
    305 Views
    No one has replied
  • 4 Votes
    8 Posts
    426 Views

    @Panda said in Upgrade to NodeBB v3? 2BB or not 2BB, that is the question!:

    So although thats a plugin it has Widget like element and stopped working on the Theme change

    Which is normal based on the widgets being reset when you change themes.

  • Post Style View

    Solved Customisation
    67
    18 Votes
    67 Posts
    5k Views

    @cagatay

    Just add margin-left on the element like @phenomlab said to you :

    topic [component="post/parent"] { margin-left: 10px; }

    aa08c62b-4223-4cba-8c0f-c73d50474c0d-image.png

    Maybe @phenomlab have a better way

  • How to fix header side as boxed

    Solved Customisation
    10
    6 Votes
    10 Posts
    470 Views

    @phenomlab yes it caused a problem for mobile users.
    thank you for helping …

  • Forum Statistics Box

    Solved Customisation
    5
    4 Votes
    5 Posts
    448 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 1.19.3

    Solved Performance
    33
    4 Votes
    33 Posts
    3k Views

    @phenomlab

    I find the problem Mark 😉

    The error message indicated this path :

    http://localhost:4567/assets/plugins/nodebb-plugin-emoji/emoji/styles.css?v=6983dobg16u

    I change the path url on config.json

    47bacc80-f141-41e4-a261-3f8d650cc6f6-image.png

    And all it’s good 🙂

    Weird, I didn’t have to change that path before 1.19.3

    But this does not prevent the problem from a clean install with Emoji Plugin

    EDIT: After test, that resolv the problem installation for 1.18.x but not for 1.19.x (I have other error message when I run ./nodebb Setup

    For resume: NodeJS 16_x with 1.18.x is ok