Developer forum

Forum » CMS - Standard features » Comments in news list view.

Comments in news list view.

Jonas Mersholm
Reply

Hi there.

On our solution, we have to display the amount of comments, of a given article in the news module, on the frontend list.
We havent been able to figure a programatically way of doing this through the template tags, therefor we are fetching them through ajax, from the actual article page.

This gives quiet a back-hit since the analytics module (DW analytics) Seems to count ajax loaded pages as a pageview aswell, without filtering the request out, this means that the statistics are useless.

Are there any way for us to fetch the comments with template tags? If not, is it possible for you to implement a analytics-block if the request is an ajax call, into the analytics part? Which would be logical.

Best regards
Jonas


Replies

 
Mikkel Ricky
Reply
This post has been marked as an answer

You can do this in a number of ways

  • Using a Razor template for your news list
  • If the content type og a page is set, then statistics is disabled (Page > Properties > Layout > Content type)
  • Use a carefully constructed template that hides the scripts &c. that Dynamicweb usually adds to the page

I've been using an ajax template like this

@GetValue("DwContent(content)")@*
@GetValue("Stylesheets")
@GetValue("Javascripts")
<div class="dwcontent" id="content" title="Content"></div> *@

to get only the content from any modules added to the "content" place holder.

I've created a work item for us to take a look at how to make this easier for you, but for know you have to use one of the tricks mentioned above.

Best regards,
Mikkel

Votes for this answer: 1
 
Mikkel Ricky
Reply

Oh, and by the way: you should be using items for handling news. See http://items.dynamicweb.dk/en-US/News for a simple example that you can build on (cf. http://items.dynamicweb.dk/)

 

You must be logged in to post in the forum