PixyBlog Lightbox   |   Basket   |   Login   |   Register
Pixy® Blog - Expose Yourself
  PixyBlog.comPhotoblog DiscussionPhotoblog Wiki
  • Log in / create account
Displaying most commented entries
  • Page
  • Discussion
  • View source
  • History

Displaying most commented entries

From PixyWiki

Jump to: navigation, search

Contents

  • 1 Overview
  • 2 Using the Macro
  • 3 Photoblog Example
  • 4 Output

Overview

Display a list of the most commented entries on a blog. This can be done in a couple of ways; either by using the Macro to display a list of entries or by using the $model object.

Using the Macro

The macro is simple to include in your page templates and displays a list of the most commented entries and the number of comments of each entry. See the #showMostCommentedWeblogEntriesList documentation for details and an example.

Photoblog Example

For photoblogs, it can be useful to display a thumbnail image in-place of a text link. The following code shows an example of how to do this:

#set($comEntries = $model.weblog.getMostCommentedWeblogEntries(5) )
<div>
#foreach ($comEntry in $comEntries)
    #set($image = $comEntry.image)
    #set($thumb = $image.thumbSquare)
    <span>
        <a href="$url.entry($comEntry.anchor)" title="$comEntry.commentCount comments for $comEntry.title"><img src="$url.photo($thumb.path)" width="$thumb.width" height="$thumb.height" alt="#showImageAltTag($image)" /></a>
    </span>
#end
</div>

Output

Using the demo blog the following is the output from the above code:

Retrieved from "http://wiki.pixyblog.com/Displaying_most_commented_entries"
This page was last modified 17:53, 27 August 2009. This page has been accessed 136 times.
  • Privacy policy
  • About PixyWiki
  • Disclaimers
  • Powered by MediaWiki
  • Design by Paul Gu
Terms and Conditions | Privacy Policy | About | Contact us | Copyright © 2006-2008 Pixy® Ltd. All rights reserved.