Skip to:
Content
Pages
Categories
Search
Top
Bottom

Threaded layout


  • xmanca
    Participant

    @xmanca

    I’m returning to WordPress after years and found bbPress as a potentially good option to convert an old forum while converting the site to use WP. What I specifically need because of user mandate is threaded topics but they need to be in a specific layout. The default for bbpress when I enable threading, is kind of a hybrid flat/threaded. What I’d like to achieve is to have the individual posts display on a page with the thread below in the form of a thread of links to those posts/replies within the thread. This is specifically what my established users are accustomed to and what they demand. The forum goes back almost two decades (original threaded forum styling) and many of the users are original members so they don’t want any fancy, newfangled flat forums…

    I’m confident that I can create the database script to do the forum migration of posts/thread/users into WP/bbPress but need some insights for achieving layout issues. Can I get some help / insights for achieving this layout? Thank you in advance.

    Paul

Viewing 13 replies - 1 through 13 (of 13 total)
  • I’m pretty sure you’d be able to get what you’re after 🙂

    Once bbPress is activated, enable “threaded replies” in the settings.

    Use bbp_show_lead_topic(), grab the snippet from https://codex.bbpress.org/bbp_show_lead_topic/ and create a custom plugin using that code snippet.

    Then I’d suggest hoping over to the docs and do some reading:

    Theme Compatibility


    xmanca
    Participant

    @xmanca

    Thank you for the reply Stephen. I will work on this the next few hours and see if I can do it.

    Paul


    xmanca
    Participant

    @xmanca

    OK so I’ve had some limited success thanks to your help, but I am stuck on where the replies are displayed. What I have now is the main topic on top and then the paginated replies below.

    I would like to get the replies to only be shown as links to the actual replies. I believe that I have isolated where this is in the code:
    line 45 of the includes/replies/function.php
    $reply_id = wp_insert_post( $reply_data );

    Am I on the right track here or totally off base?


    xmanca
    Participant

    @xmanca

    OK so I’ve had some limited success thanks to your help, but I am stuck on where the replies are displayed. What I have now is the main topic on top and then the paginated replies below.

    I would like to get the replies to only be shown as links to the actual replies. I believe that I have isolated where this is in the code:
    line 45 of the includes/replies/function.php
    $reply_id = wp_insert_post( $reply_data );

    Am I on the right track here or totally off base?


    xmanca
    Participant

    @xmanca

    I’m totally stuck on this. What I need is one post per page with a tree view of the thread under the post linking to the individual replies. Does that make sense? Rather than all of the messages displayed together on the page. Should I post this in a different forum?

    You shouldn’t need to edit any of bbPress functions.

    You can achieve what you are after by adding your own custom templates:

    This is a guide to getting started with these: https://codex.bbpress.org/themes/amending-bbpress-templates/

    This is a helpful reference for bbPress’ templates: https://codex.bbpress.org/themes/theme-compatibility/template-hierarchy-in-detail/

    What I think you’d be looking to do is make changes to your child themes loop-single-reply.php template so that only the links to replies are there by removing bbp_reply_content() .


    xmanca
    Participant

    @xmanca

    my replies seem to be getting blocked is there a reason?

    [mod note: Fixed. Be aware of our 2 link limit.]


    xmanca
    Participant

    @xmanca

    Hi Stephen,
    I had actually created the custom template previously and tried what you said. But all it does is eliminate the content and this is why I moved on to try to identify what is going on in the function. I would much rather not touch the function code and do everything via custom template for a lot of reasons including staying safe with future updates.

    As it is, if I remove the reply_content code in the child theme, it still leaves the replies in there but just with no content in them other than the author area. If I remove the author area as well then I no longer see anything but there are no links to the replies.

    I tried figuring out some sort of reply_url but nothing has worked for me – where I’m stuck. The closest I’ve come is to use this:

    <?php bbp_reply_url(); ?>

    in that same area. The result is that I get plain text urls (not hyperlinks) in a thread tree of sorts. However those links do not link to the actual content of the reply. So what you get is like this:

    The topic is at the url http://testsite.com/forum/topic/test1/
    The content of the original post is at the top and underneath are urls like:
    August 27, 2016 at 9:04 pm http://testsite.com/forum/topic/test1/#post-10
    August 27, 2016 at 9:06 pm http://testsite.com/forum/topic/test1/#post-11
    August 27, 2016 at 9:03 pm http://testsite.com/forum/topic/test1/#post-8
    August 27, 2016 at 9:04 pm http://testsite.com/forum/topic/test1/#post-9

    If I go to any of those urls then it just displays the original post and scrolls down to where that URL exists in the tree below the original post content. The actual content of the reply is not displayed – just the content of the original post.


    Robkk
    Moderator

    @robkk

    @xmanca

    Share an image of what exactly you are looking for in your custom layout.


    xmanca
    Participant

    @xmanca

    OK example:

    Not Logged in ViewNot Logged in View

    Loggedin As Admin viewLoggedin As Admin view Note the reply form underneath.

    Also clicking any of the links would put the reply in the top (only) content as opposed to the original post.


    Robkk
    Moderator

    @robkk

    Okay, yeah this site does have an interesting layout.

    http://eat.at/swap/forum1/251729_Help_Need_recipe_for_fig_jam_ASAP

    From what I can see real quick.

    Your not going to edit the loop-single-reply.php file like @netweb suggested, because after clicking the reply title link you are redirected to a normal layout single reply. So to get this layout you are going to edit content-single-topic.php, remove the pagination, and place a custom template instead of loop-replies..php so that you won’t mess with replies in a forum profile.

    <?php if ( bbp_has_replies() ) : ?>
    
    	<?php bbp_get_template_part( 'pagination', 'replies' ); ?>
    
    	<?php bbp_get_template_part( 'loop',       'replies' ); ?>
    
    	<?php bbp_get_template_part( 'pagination', 'replies' ); ?>
    
    <?php endif; ?>

    Replace the above code with this for example.

    <?php if ( bbp_has_replies() ) : ?>
    
    	<?php bbp_get_template_part( 'loop',       'classic-threads' ); ?>
    
    <?php endif; ?>

    The code that will be in loop-classic-threads.phpwill be a copy of loop-replies.php and a very minimal loop-single-reply.php. Wherever say <?php bbp_get_template_part( 'loop', 'single-reply' ); ?> is called in the new loop-classic-threads.php file, I would just copy the whole loop-single-reply.php template where that get template function was and keep only the code you need.

    The code that is going to be in the area you put the loop-single-reply.php code is only going to have the username, date, maybe the reply positions, and reply title. The reply title is going to mostly come from a customized version of the bbPress reply title plugin. But you are going to output the reply title in the template as a link. A link (I think bbp_reply_url() is the right function ) to the single reply template, which is only 1 reply isolated, which bbPress can do.

    Does this help enough??

    I’m gonna see if I can recreate most of this layout later


    xmanca
    Participant

    @xmanca

    Thank you very much for all of this. Here is my progress:

    Some success with some issues remaining


    Robkk
    Moderator

    @robkk

    here is what I got.

    I had to edit loop-single-reply.php after all,

    I used a conditional to output the minimal layout only for single topics only.

    I had to use bbp_reply_permalink(); instead of bbp_reply_url();.

    Like I said you for sure do have to edit the bbPress reply titles plugin for what you exactly want, your gonna have to possibly make the reply title required as well.

    You are going to end up doing a lot of customization to get the rest of the funcitonality, because I am not sure how submitting a threaded reply works on the other forum.

    You are also going to figure out how to show the threads on the single reply page, for the specific topic they were originally from.

    Bunch more customizing, much more than free support could possible help with.

    I will share any custom templates I used later.

    Classic threads

Viewing 13 replies - 1 through 13 (of 13 total)
  • You must be logged in to reply to this topic.
Skip to toolbar