Most Read Blog Posts Widget

The Most Read Blog Posts widget displays a list of most read blog posts on a site as a list of pages.  With this feature enabled, this widget is fairly simple to configure and works by tracking a hit count for each Blog Post page.

The widget relies on the Percussion DTS to update the list dynamically.


Configuration

The Most Read Blog Posts widget can be configured for any blog via the Blog Post widget.  To enable blog tracking for a blog, open the template with the blog post widget on it and navigate to the Layout tab.  Double click the Blog Post widget and display its properties.  At the bottom, select 'Track blog post.'

track blog posts button

The Most Read Blog Posts widget gets updated every 5 minutes as a default. The time delay is implemented for performance reasons to prevent a large amount of site traffic from overloading the widget. The time delay can be configured to run at desired increments:

  • Navigate to <DTS_Root> --> Deployment --> Server --> conf --> perc
  • Rename perc-metadata-services.properties.sample to perc-metadata-services.properties

The following property configures the delay when updating the widget.  The time property is set in seconds.

  • blogpot.scheduler.interval: determines the delay between updates after initial startup


The DTS will need to be restarted after making these updates.

Once configured, to verify the service is running, the following URL can be accessed:

http://your_site.com/perc-metadata-services/metadata/visits/status

If successful, the URL will return "Running," otherwise it will return an error page.


Widget Configuration Properties (Layout Tab)

 Most-Read Blogs Post Widget Layout Properties

Section path – The location of the blog in the site.  Must match the path directly after /Sites including the site name: /site_name/blog_location.

Note: As an example, if a site in CM1 is named www.testsite.com and includes a blog off the root such as www.testsite.com/blogs, then /www.testsite.com/blogs will be the section path.

Show page summary - Checkbox used to specify whether the text of the page summary entered on the page metadata will be included in the list published on the page.

Hide date and time - Checkbox used to specify whether the date and time of the blog post will be displayed.

Format of post date: A format to apply to the Auto list entries' post date.

Date Format Locale: Country and Language to use when formatting the published date.

Text to use for "more link" - This is the text that displays at the end of the page summary.

Time period - This provides a way to filter the most read blog posts by that day, week, month, year, or by all time.

Heading style - The HTML element used to wrap the list title.

Aria-role - The text to set for the 'role=' attribute.  Defaults to 'region'.

Aria-label - The text to set for the 'aria-label' attribute.  If it is not set, it defaults to using the title of the list if present, otherwise defaults to 'Most Read Blog Posts'.

Number of results - The max number of results possible in the list.

Sort order by hits - Provides a way to sort the list by most hits (descending) or the least number of hits (ascending).

List title - The title of the list.

Styling the Widget

The Most Read Articles widget exposes the following classes that can be used to style the widget in your Theme css.

CSS ClassDescription
perc-most-read-blog-posts-viewApplies to the container div for the Most Read list
perc-most-read-list-titleApplies to the list title
perc-most-read-list perc-list-mainApplies to the Ordered List (ol) that contains the list
perc-most-read-page-itemApplies to each list item (li) that contain the list
perc-most-read-page-titleApplies to each Page title
perc-most-read-list-date-containerApplies to the Content Post Date for each linked Page if post date is enabled
perc-most-read-page-summaryApplies to the Page Summary for each linked page if summary is enabled.