This is the community forum. For a developer response use the Client Area.
Follow us on Facebook, Twitter and YouTube!

auto update comments
#1

Hi there,

I was just wondering if/why there is no auto update function in the background for updating the comment list.
Every time, I want to see new comments, I have to reload the whole page.

Is this a bug or is there a way to achieve this?
Reply
#2

Hi MZL,

It's not a bug. It's just because I don't believe anybody has ever requested it before. For example on the Roadmap I added 'Instant Alerts' which would be the closest thing to what you've described. This would show an alert message if a new comment is posted while the user is on the page and clicking the alert would refresh the comments. However it doesn't have any votes as people have decided to vote for other features instead. Also are you sure you would want it to auto refresh? I ask because this would cause the page to jump about when the user is trying to read it.

Have you completed the interview?
Reply
#3

Hi Steven,

I need this feature because I use the comments in a live discussion and not in a nearly "static" page.
But I can create a workaround by tracking the users activity and reload the iframe every 2 minutes if there is no user activity like typing/mouse-/touch-events.
Reply
#4

Hi STeven,
is there a function, I can call to reload the comments or di I have to destroy the div and regenerate it?
Reply
#5

The way the script reloads comments is by calling the cmtxRefreshComments JavaScript function near the bottom of the file /frontend/view/default/javascript/common.js. That gets fired by various events such as a user sorting the comments or searching etc. I suppose one way might be to frequently "trigger" one of those events, wrapping it in something like JavaScript's setInterval(). I think the most suitable event to trigger would be when the user clicks to return to comments after doing a search, which could be triggered with $('.cmtx_return a').trigger('click'); As you're using an iFrame I think this would need to be triggered from within the iFrame, such as in /frontend/view/default/template/main/comments.tpl. I haven't tested any of this but it should hopefully work.

Have you completed the interview?
Reply
#6

Hi Steven,

your solution didn´t work in my case.
I just activated the pagination and made a time interval with:
document.querySelector('.cmtx_pagination_box').click();
to simulate a click on the pagination button.

This works for me Wink
Reply
#7

Excellent I'm glad you found a solution.

Have you completed the interview?
Reply


Possibly Related Threads…
Thread / Author Replies Views Last Post
Last Post by Steven
27-Jul-2021, 07:12 PM
Last Post by clixcity
29-Jul-2020, 07:56 PM
Last Post by Steven
09-Jul-2018, 08:40 PM
Last Post by vkp
22-May-2017, 04:28 AM
Last Post by tashi
23-Jul-2015, 07:45 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)