talk
talk copied to clipboard
Update Comment count on Ajax call (Infinite scroll)
When using dynamic content load comment count is blank. I try to call count.js via ajax call with no luck. Does anybody has a recipe?
Can you give an example of how the elements are loaded? Corals count.js
currently doesn't monitor the page for insertions of new data-coral-*
attributes, as it's only done once on dom load.
For example https://www.andreaverlicchi.eu/lazyload/ script has useful update() function to check DOM again when for example (in my case) new content is being appended to container as user scrolls down, in my case i use Drupal7 with Infinite scroll module (https://www.drupal.org/project/gd_infinite_scroll). So when the new elements append to container i fire update function so the comment count shows up. Currently it's empty of course.
GD infinite scroll project https://git.drupalcode.org/project/gd_infinite_scroll/-/blob/7.x-1.x/js/gd_infinite_scroll.js
That's sufficient! Coral doesn't currently have a mechanism for this currently, but we've added it to our backlog.
any updates regarding this? i've integrated coral talk on a page with infinite scroll containing articles and each article has it's own comment section. so far so good, but the count script only works for the top article unless you reload further down. comments and everything else are working just fine.
we're looking into solutions to modernize our comment counts solutions but no timeline as of yet unfortunately