Using wpDiscuz on s...
 
Notifications
Clear all

Using wpDiscuz on site that loads content dynamically

3 Posts
2 Users
0 Reactions
930 Views
(@evgenyp)
New Member
Joined: 5 years ago
Posts: 2
Topic starter  

Hello,

Are there any plans to make wpDiscuz play nice with websites that load posts dynamically via AJAX to show them in a popup and when there might be 2 posts with comments loaded in a given time - parent post and child opened in a popup.

I found it does not work out of the box when you have a wpDiscuz comment form on the parent page and then show another post via AJAX in a popup. First, it looks like Javascript state including Post ID is initialized only once on page load and cannot be changed later. Second, when a comment is posted in a popup, wpDiscuz will dynamically update comments in the popup and on the parent page (so the update selector is not restricted to the form where the comment was posted). I wonder if there is a recipe to make wpDiscuz play well with popups and if there are any plans to make wpDiscuz client-side more flexible for dynamic sites.

 

Thank you

This topic was modified 5 years ago by evgenyp

   
Quote
Astghik
(@astgh)
Illustrious Member Admin
Joined: 7 years ago
Posts: 6146
 

Hi @evgenyp,

I'm really sorry, but this is not planned yet. This required very large changes in the plugin core.


   
ReplyQuote
(@evgenyp)
New Member
Joined: 5 years ago
Posts: 2
Topic starter  

Hi Astghik,

Thank you for your quick reply. Strange. I don't know wpDiscuz internals, but it looks like entirely a client-side problem, so just the JavaScript code needs to be refactored a bit, so it does not assume there is only one comment form on the page. I was able to get wpDiscuz functioning in a popup after patching the JavaScript code. I didn't finish it and dropped in favor of a custom solution.


   
ReplyQuote
Share:
Scroll to top