Skip to content

Post Style View

Solved Customisation
  • @cagatay Your NodeBB is up to date, so not an issue there. Just seems odd that no matter what I try, it doesn’t trigger. Investigating

    @phenomlab maybe there is a problem in my vps or ubuntu is not clearlu working or library etc…

  • @phenomlab maybe there is a problem in my vps or ubuntu is not clearlu working or library etc…

    @cagatay Not sure, but will check out a theory I have first before we go down that route.

  • @phenomlab maybe there is a problem in my vps or ubuntu is not clearlu working or library etc…

    @cagatay Found the issue. It appears that the hook I should be calling is in fact action:posts.loaded and not action:ajaxify.loaded 🤦

    Should be fixed now but take a look. The best way to test this is to find a topic with lots of posts, and scroll to the bottom. Then, reload the page, and start scrolling up from the bottom to the top. As the new posts are added into the DOM, that function I wrote should execute and add the missing class

    For anyone else following this thread, the two required jQuery functions are

    $(window).on('action:posts.loaded', function(data) {
    $(document).ready(function() {
    if ($('li[component="post"]').hasClass("")) {
    console.log("New posts detected,so adding classes for messenger type view");
    $('li[component="post"]').addClass('topic-response-post');
    }
    });
    });
    $(window).on('action:ajaxify.end', function(data) {
    $(document).ready(function() {
    if ($('li[component="post"]').hasClass("")) {
    console.log("Adding required classes for messenger type view");
    $('li[component="post"]').addClass('topic-response-post');
    }
    });
    });
  • @cagatay Found the issue. It appears that the hook I should be calling is in fact action:posts.loaded and not action:ajaxify.loaded 🤦

    Should be fixed now but take a look. The best way to test this is to find a topic with lots of posts, and scroll to the bottom. Then, reload the page, and start scrolling up from the bottom to the top. As the new posts are added into the DOM, that function I wrote should execute and add the missing class

    For anyone else following this thread, the two required jQuery functions are

        $(window).on('action:posts.loaded', function(data) {
            $(document).ready(function() {
            if ($('li[component="post"]').hasClass("")) {
                console.log("New posts detected,so adding classes for messenger type view");
                $('li[component="post"]').addClass('topic-response-post');
            }
        });
    });
        $(window).on('action:ajaxify.end', function(data) {
            $(document).ready(function() {
            if ($('li[component="post"]').hasClass("")) {
                console.log("Adding required classes for messenger type view");
                $('li[component="post"]').addClass('topic-response-post');
            }
        });
    });
    

    @phenomlab i checked topic with a lots of posts 3 times 🙂 everything is clear and very well now. thank you your effort.

  • @phenomlab i checked topic with a lots of posts 3 times 🙂 everything is clear and very well now. thank you your effort.

    @cagatay No problems. Glad it’s all working. I need to document this for others to be able to use.

  • @cagatay No problems. Glad it’s all working. I need to document this for others to be able to use.

    @phenomlab said in Post Style View:

    @cagatay No problems. Glad it’s all working. I need to document this for others to be able to use.

    this post is very good document for the users who will want to use it 🙂

  • @phenomlab said in Post Style View:

    @cagatay No problems. Glad it’s all working. I need to document this for others to be able to use.

    this post is very good document for the users who will want to use it 🙂

    @cagatay Yes, but I want to create something more concise and simpler to follow

  • undefined phenomlab has marked this topic as solved on 28 Oct 2022, 12:18
  • @cagatay Found the issue. It appears that the hook I should be calling is in fact action:posts.loaded and not action:ajaxify.loaded 🤦

    Should be fixed now but take a look. The best way to test this is to find a topic with lots of posts, and scroll to the bottom. Then, reload the page, and start scrolling up from the bottom to the top. As the new posts are added into the DOM, that function I wrote should execute and add the missing class

    For anyone else following this thread, the two required jQuery functions are

        $(window).on('action:posts.loaded', function(data) {
            $(document).ready(function() {
            if ($('li[component="post"]').hasClass("")) {
                console.log("New posts detected,so adding classes for messenger type view");
                $('li[component="post"]').addClass('topic-response-post');
            }
        });
    });
        $(window).on('action:ajaxify.end', function(data) {
            $(document).ready(function() {
            if ($('li[component="post"]').hasClass("")) {
                console.log("Adding required classes for messenger type view");
                $('li[component="post"]').addClass('topic-response-post');
            }
        });
    });
    

    @cagatay in case you’re still following this thread, I found a far more efficient way of adding the classes using jQuery. To this end, you can change this block above with this code

    // Target those elements already loaded in the DOM
    $(document).ready(function() {
    $(window).on('action:ajaxify.end', function(data) {
    $('li[component="post"]').each(function(i, obj) {
    if (!$(this).hasClass('self-post') || (!$(this).hasClass('self-post'))) {
    console.log("Adding required classes for messenger type view");
    $(this).addClass('topic-response-post');
    }
    });
    });
    });
    // Target elements dynamically added to the DOM on post load
    $(document).ready(function() {
    $(window).on('action:ajaxify.loaded', function(data) {
    $('li[component="post"]').each(function(i, obj) {
    if (!$(this).hasClass('self-post') || (!$(this).hasClass('self-post'))) {
    console.log("Adding required classes for messenger type view");
    $(this).addClass('topic-response-post');
    }
    });
    });
    });
  • @cagatay in case you’re still following this thread, I found a far more efficient way of adding the classes using jQuery. To this end, you can change this block above with this code

    // Target those elements already loaded in the DOM
    $(document).ready(function() {
        $(window).on('action:ajaxify.end', function(data) {
            $('li[component="post"]').each(function(i, obj) {
                if (!$(this).hasClass('self-post') || (!$(this).hasClass('self-post'))) {
                    console.log("Adding required classes for messenger type view");
                    $(this).addClass('topic-response-post');
                }
    
            });
        });
    });
    // Target elements dynamically added to the DOM on post load
    $(document).ready(function() {
        $(window).on('action:ajaxify.loaded', function(data) {
            $('li[component="post"]').each(function(i, obj) {
                if (!$(this).hasClass('self-post') || (!$(this).hasClass('self-post'))) {
                    console.log("Adding required classes for messenger type view");
                    $(this).addClass('topic-response-post');
                }
    
            });
        });
    });
    

    @phenomlab said in Post Style View:

    // Target those elements already loaded in the DOM
    $(document).ready(function() {
    $(window).on(‘action:ajaxify.end’, function(data) {
    $(‘li[component=“post”]’).each(function(i, obj) {
    if (!$(this).hasClass(‘self-post’) || (!$(this).hasClass(‘self-post’))) {
    console.log(“Adding required classes for messenger type view”);
    $(this).addClass(‘topic-response-post’);
    }

    });
    });

    });
    // Target elements dynamically added to the DOM on post load
    $(document).ready(function() {
    $(window).on(‘action:ajaxify.loaded’, function(data) {
    $(‘li[component=“post”]’).each(function(i, obj) {
    if (!$(this).hasClass(‘self-post’) || (!$(this).hasClass(‘self-post’))) {
    console.log(“Adding required classes for messenger type view”);
    $(this).addClass(‘topic-response-post’);
    }

    });
    });

    });

    thank you Mark.
    changed it.

  • @cagatay in case you’re still following this thread, I found a far more efficient way of adding the classes using jQuery. To this end, you can change this block above with this code

    // Target those elements already loaded in the DOM
    $(document).ready(function() {
        $(window).on('action:ajaxify.end', function(data) {
            $('li[component="post"]').each(function(i, obj) {
                if (!$(this).hasClass('self-post') || (!$(this).hasClass('self-post'))) {
                    console.log("Adding required classes for messenger type view");
                    $(this).addClass('topic-response-post');
                }
    
            });
        });
    });
    // Target elements dynamically added to the DOM on post load
    $(document).ready(function() {
        $(window).on('action:ajaxify.loaded', function(data) {
            $('li[component="post"]').each(function(i, obj) {
                if (!$(this).hasClass('self-post') || (!$(this).hasClass('self-post'))) {
                    console.log("Adding required classes for messenger type view");
                    $(this).addClass('topic-response-post');
                }
    
            });
        });
    });
    

    @phenomlab there is small problem after revised codes which you shared.
    problem is shown below; answered nick and labels nested.

    8cb60812-c40c-4834-bdb2-bd8ef6271340-image.png

  • @phenomlab there is small problem after revised codes which you shared.
    problem is shown below; answered nick and labels nested.

    8cb60812-c40c-4834-bdb2-bd8ef6271340-image.png

    @cagatay that’s just a margin missing. The code I provided won’t be causing that. If you look for the element in the developers console and add a margin-left value to it, that should resolve it.

  • @cagatay that’s just a margin missing. The code I provided won’t be causing that. If you look for the element in the developers console and add a margin-left value to it, that should resolve it.

    @phenomlab may i use this code?

    .topic-owner-post [itemprop="author"] {
    float: left;
    }
    // Add these to (or edit) the existing classes you have
    .user-level-topic {
    float: none;
    }
    .group-label {
    margin-top: -1px;
    }
    .topic-owner-post [itemprop="author"]:after {
    margin-top: 1px;
    height: 18px;
    }
  • @phenomlab may i use this code?

    .topic-owner-post [itemprop="author"] {
        float: left;
    }
    // Add these to (or edit) the existing classes you have
    .user-level-topic {
        float: none;
    }
    .group-label {
        margin-top: -1px;
    }
    .topic-owner-post [itemprop="author"]:after {
        margin-top: 1px;
        height: 18px;
    }
    

    @cagatay from the screenshot you provided, it looks like you’ve used them. They are fine to use, but you are missing a couple of styles.

    I’ll have a look at this tomorrow and give you the remainder of the code you need.

  • @cagatay from the screenshot you provided, it looks like you’ve used them. They are fine to use, but you are missing a couple of styles.

    I’ll have a look at this tomorrow and give you the remainder of the code you need.

    @phenomlab i cant fix it 😞

    0ec83f76-a140-46dc-9a9f-b4f6f3d98b9c-image.png

  • @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

  • 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 💗


62/67

21 Nov 2022, 23:31



Related Topics
  • Nodebb design

    Solved General 11 Jul 2023, 10:13
    1 Votes
    2 Posts
    319 Views
    @Panda said in Nodebb design: One negative is not being so good for SEO as more Server side rendered forums, if web crawlers dont run the JS to read the forum. From recollection, Google and Bing have the capability to read and process JS, although it’s not in the same manner as a physical person will consume content on a page. It will be seen as plain text, but will be indexed. However, it’s important to note that Yandex and Baidu will not render JS, although seeing as Google has a 90% share of the content available on the web in terms of indexing, this isn’t something you’ll likely lose sleep over. @Panda said in Nodebb design: The “write api” is preferred for server-to-server interactions. This is mostly based around overall security - you won’t typically want a client machine changing database elements or altering data. This is why you have “client-side” which could be DOM manipulation etc, and “server-side” which performs more complex operations as it can communicate directly with the database whereas the client cannot (and if it can, then you have a serious security flaw). Reading from the API is perfectly acceptable on the client-side, but not being able to write. A paradigm here would be something like SNMP. This protocol exists as a UDP (UDP is very efficient, as it is “fire and forget” and does not wait for a response like TCP does) based service which reads performance data from a remote source, thus enabling an application to parse that data for use in a monitoring application. In all cases, SNMP access should be “RO” (Read Only) and not RW (Read Write). It is completely feasible to assume complete control over a firewall for example by having RW access to SNMP and then exposing it to the entire internet with a weak passphrase. You wouldn’t do it (at least, I hope you wouldn’t) and the same ethic applies to server-side rendering and the execution of commands.
  • 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 [image: 1679077966615-aeef638f-4188-489d-a9f2-f3a26dbca9d8-image.png] It will then work [image: 1679077992245-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 8 Nov 2022, 13:46
    0 Votes
    7 Posts
    461 Views
    @phenomlab no forum is working goods. there is no eror message since yestarday.
  • 3 Votes
    2 Posts
    257 Views
    @eveh It’s not a GIF, no. It’s actually a webp file so made much smaller, and uses keyframes to control the rotation on hover. You can easily make your own though The CSS for that is as below @keyframes rotate180 { from { transform: rotate(0deg); } to { transform: rotate(180deg); } } @keyframes rotate0 { from { transform: rotate(180deg); } to { transform: rotate(0deg); } } Your milage may vary on the CSS below, as it’s custom for Sudonix, but this is the class that is used to control the rotate .header .forum-logo, img.forum-logo.head { max-height: 50px; width: auto; height: 30px; margin-top: 9px; max-width: 150px; min-width: 32px; display: inline-block; animation-name: rotate180, rotate0; animation-duration: 1000ms; animation-delay: 0s, 1000ms; animation-iteration-count: 1; animation-timing-function: linear; transition: transform 1000ms ease-in-out; }
  • 0 Votes
    5 Posts
    571 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/
  • 3 Votes
    2 Posts
    655 Views
    @pwsincd welcome to sudonix, and thanks for the comments. What your looking for is here https://sudonix.com/topic/195/nodebb-welcome-message/3?_=1648295651358
  • 4 Votes
    5 Posts
    755 Views
    @phenomlab thanks
  • 0 Votes
    3 Posts
    848 Views
    @phenomlab many thanks Mark .