Asset Builder to create comments


(Ryan Archer) #1

Have followed the Squiz Guide to create an asset builder that is used so that logged in (and public users) can comment on News Items. Have followed the instructions here http://manuals.matrix.squizsuite.net/news/chapters/commentto set it up but whenever a comment is created, it will not show up on the page after successfully creating it.

 

I just get a "/?" appended to the URL location of the News item URL e.g. http://mywebsite.org.au/news-blog/category-2/news-item-1/?

 

Repeating the same keywords on the "created" bodycopy as they are in "logged in" bodycopy just ensures that I see the text of the comment I just made still appearing within the add comment box and the page does not update to show the newly posted comment. I might just add that we are not using a comment moderation system either so we really want the comment to show up as soon as it is posted with NO CACHE happening.

 

So to be able to see the updated news item page with new comment underneath it I have to append a "/_nocache" to the URL - this is even after making a trigger action up to listen for a new comment being created in the website and then clearing the matrix cache on every asset within the blog directory. It's like that action does not work. The other trigger actions work like sending an email, removing metadata schema and setting the status of the asset to LIVE.

 

Anyone have any similar experiences?


(Bart Banda) #2

Definitely sounds like a cache issue. However, I would submit and load the comment via AJAX so that the whole page doesn't have to be refreshed. A much nicer user experience and you get around the caching issue. Also good for performance if you end up having a lot of comments, you could then load the comments via ajax after the main news page has been loaded to speed the page load up as well. 

 

How are you listing the comments by the way? Using an asset listing nested into the paint layout that is applied to the news items?


(Ryan Archer) #3

Interesting thing is I have a trigger firing that is supposed to clear the cache on the whole blog directory once a comment has been posted/published. I have listed the comments as you have described, pretty much closely following the recommendations within the Squiz Matrix guide.

 

Are there any notes/instructions on the Squiz guide on how to submit and load comment with AJAX?


(Bart Banda) #4

No official guide anywhere, but if you are familiar with JS and AJAX it should be relatively straight forward. You can always get some more detailed advice from the Brisbane production team by sending a support ticket in?

They can then also have a look at the caching issue you are experiencing.