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 20 replies - 26 through 45 (of 45 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.


    MBV
    Participant

    @mbv

    How did you guys enable ajax for buddypress group forum?
    That link to https://cloudup.com/czqFBqJE8TE is expired so I can’t see the code that was edited. Are you able to add it again here?


    MBV
    Participant

    @mbv

    Oh, wait… there was no solution to having ajax reply for buddypress group forum reply?

    What about just for non-BP bbpress forum reply? Is ajax reply possible?


    MBV
    Participant

    @mbv

    @tkserver Wow, so I just joined up to your ute website to check out the homepage you mentioned… I see that users can reply directly to the forum feed displayed on the homepage. That is very good, thanks for sharing!

    That’s not a Buddypress activity feed is it? It would be great if that functionality could be added to the Buddypress activity feed somehow.


    MBV
    Participant

    @mbv

    @tkserver It wasn’t possible to add the reply box dynamically to the actual forum page though?


    MBV
    Participant

    @mbv

    So this is what I understand from this thread so far, to provide clarity moving forwards:

    1. Dynamic reply box that opens next to post replying to in forum is actually already a feature of bbpress, but not for BuddyPress group forums.
    2. Some themes seem to not engage this functionality and the way to fix that is to copy the reply.js file into a folder called js that is at the root of child theme.
    3. It works with visual editor

    So the only problem is that it does not work for Buddypress Group forums. However, @robkk mentioned, earlier in this thread, a patch he made. But he has not been active on these forums for over a year.

    https://bbpress.trac.wordpress.org/ticket/2974
    It is pretty easy to workaround this issue as well, since all you have to do is enqueue the javascript with a different conditional or enqueue it sitewide, but doing it sitewide might cause another issue somewhere.
    Here I just added a bbpress-functions.php file to a twentysixteen child theme. I edited out the conditional causing the issues with groups. You can test this on my test site as well.
    You would have to remove the file later if the trac tickets patch I linked to is committed and you are using version 2.6 of bbPress, so that you can have the file enqueued on the pages where it is needed.
    https://cloudup.com/czqFBqJE8TE

    The trac ticket he mention seems to be resolved yet it’s not working for BP group forums. The link to the code on cloudup is broken.

    So that’s the summary of where we are at on this thread… the big question is, does anyone have any insight or can help with enabling the dynamic reply box to BP group forums topics?


    jameshogan03
    Participant

    @jameshogan03

    I’d really love some advice on this. My buddypress group forums are functioning great except the reply form is still stuck in 1998.

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