Skip to:
Content
Pages
Categories
Search
Top
Bottom

how to create dynamic reply-box


  • Jon Fergus
    Participant

    @jon-fergus

    I assume this is pretty standard, but on our forum site (http://nexus.universaltheosophy.com/), the bbpress “reply box” is located at the bottom of any given Topic post. So, when someone wants to reply, they need to scroll all the way down. Also, directly beneath each existing reply is a “reply button”. If someone wants to reply to an existing reply, they click this button…. but what happens is that the Topic post reloads in their browser and then they’re taken to the bottom of the Topic where the reply-box resides.

    What we want, is this: when someone clicks reply, a reply-box appears directly beneath the existing reply they’re replying to (basically, how reddit works). I’ve seen at least one site that has managed to do this with some kind of customizing of bbpress, but nobody seems to want to share.

    In order to see how the reply button on our site currently works, you can use our dummy-test-account to login (just please be respectful and don’t make me delete too much spam) UN: [redacted] PW: [redacted] And use this discussion to see how the reply function currently operates: http://nexus.universaltheosophy.com/groups/key-concepts-study-group/forum/topic/reincarnation/

    Any help at all would be hugely appreciated. The current functionality really makes for a poor forum experience for our members.

    Also, we’re currently running bbpress 2.5.10 and WordPress 4.6.1.

Viewing 14 replies - 26 through 39 (of 39 total)

  • Robkk
    Moderator

    @robkk

    One other little thing though. I notice that the reply form appears below all sub-replies of a reply, instead of directly beneath the intended reply.

    I think the reply.js code and possible other areas for threaded replies code can be improved to fix this. No idea how right now.

    When the reply form is at its default location in a bbpress topic, the Visual tab works fine. But when the reply form pops up after clicking “reply” on a comment, the Visual tab fails to work (can’t type in it or see the contents).

    I think this is another known issue. One of these tickets need to possible be reopened and include a patch for this issue.

    https://bbpress.trac.wordpress.org/ticket/2700

    https://bbpress.trac.wordpress.org/ticket/2646


    r-a-y
    Participant

    @r-a-y

    The reply form showing directly beneath the reply should be fixed as of:
    https://bbpress.trac.wordpress.org/ticket/2971

    Edit – Haven’t tested with TinyMCE though.


    Robkk
    Moderator

    @robkk

    @r-a-y

    If you have a thread or few threads of replies lets say.

    Reply 1
    _Reply 2
    __Reply 3

    If you click the reply admin link on the third reply post, the form pops up below the third reply post fine.

    If you don’t actually submit a reply to that third reply post and instead hit the reply admin link on the first reply after that, the reply form will still be under the third reply post but shifted to the left more aligned with the first reply post.

    I think that is what @jon-fergus is talking about.


    Jon Fergus
    Participant

    @jon-fergus

    r-a-y and Robkk, you can have a look on my staging site’s group topic to see the reply form location issue live. This is how it operates for me (using Robkk’s example above): Attempting to reply to Reply 1 will prompt the reply form to appear under Reply 3. Attempting to reply to Reply 2 will also prompt the reply form to appear under Reply 3. The only time the reply form appears where we want it is when replying to Reply 3 (i.e. the last reply of any column of replies, so long as there are no sub-replies).

    See here: http://staging-nexus.universaltheosophy.com/groups/test-group/forum/topic/test-group-topic/

    I think I remember seeing someone playing with the reply.js code trying to tackle this very issue, so will try to find that again. At the time it didn’t help me because I still hadn’t got reply.js to work at all.

    I’ll spend some time working through the visual tab issue. Thanks for the links.


    Jon Fergus
    Participant

    @jon-fergus

    Just for reference, the site linked to in this discussion seems to have figured out how to get the reply form to appear directly under the intended reply.

    https://buddydev.com/support/forums/topic/show-bbpress-reply-form-beneath-each-reply/


    contemplate
    Participant

    @contemplate

    @jon-fergus I got this fixed with the reply.js file you include in your child theme.

    simply change this line:
    reply.parentNode.appendChild(respond);

    to this:
    reply.parentNode.children[1].appendChild(respond);

    And the reply box should appear directly under the post you are replying to.


    Jon Fergus
    Participant

    @jon-fergus

    @contemplate This doesn’t work for me. Tried it on my staging site and there was no change. Tried it on my live site and it reverted back to the original issue (i.e. clicking reply caused the entire page to reload, and then user was brought to the static reply form).


    contemplate
    Participant

    @contemplate

    Hmm. Ok it looks like my theme (Kleo) has a different forum template. Simply put the custom reply.js file was going to the Parent Node wrapper which put the Reply form at the bottom of any child replies. I simply had to have it find the first child node of the wrapper so it could drop the reply form right underneath.

    I just looked at your staging site which is a different template. Try this instead:

    reply.appendChild(respond);


    Jon Fergus
    Participant

    @jon-fergus

    No change from that either. Same functionality, with the reply form popping up below all child replies.


    TKServer
    Participant

    @tkserver

    Check out how I’ve done replies on my home page at http://www.utehub.com

    You will have to set up an account though, to see the functionality. Check out the new post function too. I’ve also added a fully functioning text editor to each reply/post. Needless to say, the home page has taken probably hundreds of hours of development.


    lijitimit
    Participant

    @lijitimit

    @jon-fergus did you ever solve this? We’re having the same TinyMCE problem over here


    Jon Fergus
    Participant

    @jon-fergus

    @lijitimit unfortunately no. I haven’t found or seen a solution to this yet. We have both problems: 1. the reply box pops up beneath the last child-reply instead of directly under the reply one is replying to, and 2. the TinyMCE editor doesn’t work with a dynamic reply box. We’ve diabled the TinyMCE editor for replies in favor of the standard one, and still have no solution to issue 1.


    parmaker
    Participant

    @parmaker

    I posted a similar issue with this today, and found this topic. I spent several days to figure out what happens to the reply edit box. I didn’t do any customising thing, but just clean install WordPress, and bbpress and tinymce advance. Also put new reply.js under the child theme dir and exactly sent it to browser. Checked it at browser to pick the correct version.

    1. created a topic
    2. created a reply by using the editor already popped up
    3. repeated 2. a couple times
    4. now I clicked one of the reply link on reply admin links
    5. ok re-reply editor sit beautifully, and re-reply created correctly.
    6. I clicked the reply link of the reply i created at 5., i.e. i tried re-re-reply, but not yet done i changed mind to click the reply link of topic admin links, without clicking “Send” button
    7. Then bbpress could not target the one that it belongs, so reply did not go under the lead topic, but previously pointed one.
    8 at this situation, no way to reply to the lead topic until get out of the topic and come into the topic again.

    When clicking a topic from the loop-topics, href=”#new-post” of reply link of topic admin links picks up /forums/topic/2nd-topic/ as url, but the reply link of reply admin links has like this /forums/topic/2nd-topic/?bbp_reply_to=21&_wpnonce=7f844b58aa#new-post”. The query “bbp_rply_to” is looked at. So click the link, uri is changed, and the href=”#new-post” of topic admin link gets meaning totally different ball park.

    When mouse to the “a href=”#new-post” of topic admin links, firefox debugger shows /forums/topic/2nd-topic/?bbp_reply_to=21&_wpnonce=7f844b58aa#new-post, NOT /forums/topic/2nd-topic/#new-post

    So, I created a reply form just under the lead topic but on top of the first reply. Named it uniquely, and put style=”display:none;” initially. I meant, when clicking the reply link of topic admin links, my own toggler js shows/hides. That is, one reply form was dedicated to the lead topic only.

    Looks great, but the following tiny thingy has no tools and text area but visual/text tabs and tag and Send.

    I tried again to every topics and replies have its own editor under reply/topic content. forms are in there but no tools no text area.

    js, i went away 17 yrs ago, makes me sick.

    Suggestion to BBPRESS : what if make every topics/replies has its own reply form ? so just toggle it when clicking reply links. If it’s a matter of ‘bites’, well, this time is Giga,terra, isn’t it ?


    mikeboltonca
    Participant

    @mikeboltonca

    It’s nice to see some activity in this thread.

    Having to choose between dynamic reply forms (our reply.js) and a modern input method (TinyMCE) in 2017 just doesn’t seem right.

    I’ve tried to research potential solutions, but the code is a bit over my head.

    It’s known that the TinyMCE editor doesn’t like being moved around the DOM. Has anyone tried removing it, then re-adding it?
    A couple people in this thread said that worked for them.

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