Search code examples
tridiontridion-2011tridion-content-delivery

User Generated Content - dynamically retrieve popular content


Looking at the documentation for UGC in Tridion SP1 2011, is it possible to dynamically query for "popular" content - so return all pages or components ordered by rating or number of comments?

The UGC commands seem to deal with comments/rating on an individual page/component - but not querying for content based upon that data.

Is something available in CD Web Service when you install UGC?

Cheers


Solution

  • I can definitely answer this part of your question:

    Is something available in CD Web Service when you install UGC?

    Yes. When you install UGC, your CD Web Service will get new collections for these UGC item types:

    • Comments
    • ItemStats
    • Ratings
    • Users

    You can get the most popular items like this:

    .../odata.svc/ItemStats?$orderby=AverageRating desc
    

    If you filter it first and then limit the number of results it'll probably result in a slightly faster query:

    .../odata.svc/ItemStats?$orderby=AverageRating desc&$filter=AverageRating gt 0.0&$top=5
    

    I expect that ItemStats are probably also available through the Java and .NET APIs.