Is there a way to separate a question block from all answers block?



  • I would like to write HTML specific for an answer, and HTML specific for a question. I am looking at all the current themes but it seems the way most developers are doing it is by keeping all threads consistent inside the loop, then at the top of the loop displaying the title.

    i.e

    {title}
    <!-- BEGIN posts -->
        <li>Thread</li>
    <!-- END posts -->
    

    I am trying to figure out a way to display a topic like

    <!-- IF question -->
    <div id="questions-container">
    posted {time} by {user.name}
    <h1>{title}</h1>
    <div class="question">
        Blah
    </div>
    </div>
    <!-- ELSEIF answer -->
       answer html
    <!-- ENDIF question -->
    

    Any advice?



  • I found the answer https://docs.nodebb.org/en/latest/themes/templates.html

    <!-- BEGIN posts -->
    <!-- IF @first -->
    <h1>Main Author: {posts.username}</h1>
    <!-- ENDIF @first -->
    {posts.content}
    <!-- IF @last -->
    End of posts. Click here to scroll to the top.
    <!-- ENDIF @last -->
    <!-- END posts -->



Suggested Topics

| |