Forum Discussion

miikka's avatar
miikka
Maven
8 years ago

Using Quick Reply outside ForumMessage

Hi,

has anybody tried and successfully used quick-reply-button and quick-reply outside the default location of Forum Message? I already tested just placing these in a custom location and obviously they do not work directly so maybe there's some little hack which for this?

 

Cheers,

.M

  • miikka - Where do you want to put this one? This will only work in the Forum Message quilt not outside it. Will work as long as your custom location is inside Forum Message quilt.

    I hope this helps.
    • miikka's avatar
      miikka
      Maven

      thanks VarunGrazitti

       

      I'm working on a custom navigation where ideally I'd like to reuse the existing quick reply logic if possible. So I'll investigate if there's a feasible way of placing at least some of the code within Forum Message but if that starts to like a hack, then it's time for some custom development :smileyhappy:

       

      Might be easier just trying to tap into the existing event listeners and ajax calls while doing custom code for the UI bit. One other option is to use jQuery to tweak the markup but that sounds relatively hacky as well.

       

      Cheers,

      .M

       

       

      • PerBonomi's avatar
        PerBonomi
        Boss

        I assume that quick reply uses env.context, so placing it outside confuses it, not finding a message id to work with.

        You could make a very simple custom component along these lines:

        <span class="button" id="bt1">Quick Reply</span>

        <textarea id="qr" class="hidden"></textarea>

        <span class="button" id="qr_submit" data-cust-id="${page.context.message.uniqueId}">Submit</span>

         

        Then do some simply jquery to toggle the textarea on click of #bt1, and on click of #qr_submit grab the textarea value then use body = value?url, msg_id = $(this).attr("data-cust-id") and call a simple endpoint to do your posting.