Trending Articles

🚧

Legacy tool

The V2 legacy version of this tool has been deprecated. Customers wishing to use the trending articles widget need to move to V3

Highlight the stories that are resonating with your community and feature stories that are trending on your site in real time, based on their recent number of comments, using the Trending Articles tool.

Trending Articles can be set up according to two criteria: article age and trend window. The article age allows you to exclude older articles from the list. The trend window sets the time period to track for each article - for example, a trend window of 5 minutes will list articles that are receiving the most comments over the past five minutes. This plugin is updated in real time, displaying the most recent results and updates to your audience automatically.

You can detect when the Trending Articles plugin is loaded on the page using the {Widget} Loaded event. Learn more here

<div class="viafoura">
        <div class="vf-widget vf-articles"
            data-widget="trending-articles"
            data-sort="comments"
            data-days-published="7d"
            data-trend-window="1h"
            data-realtime="true"
            data-limit="5"
            data-title="Trending Articles"
            data-force-limit="true"
            data-style="full">
        </div>
</div>

data-style="full"

data-style="mini"

Installation Parameters: Trending Articles

Setting

Description

Accepted Values

Default

Notes

data-title

The title you want displayed at the top of the plugin

data-sort

The sorting method applied to the articles you want returned comments

Shows articles with the most number of comments

comments

data-days-published

The number of days since the article was created. This is also referred to as the article age.

all = Shows all articles and does not filter by an article creation date

1d = Only show articles created in the last 24 hours (1 day)

3d = Only show articles created in the last 3 days

7d = Only show articles created in the last week (7 days)

30d = Only show articles created in the last month (30 days)

7d

data-days-published must be greater than or equal to the data-trend-window or there will be no articles to return.

data-trend-window

Size of sliding window to use

1h, 1d, 3d

1h

This determines the size of the trend window. For example, when set to 1h, a list is retrieved with the articles that have received the most comments in the past 1 hour.

data-trend-window must be less than or equal to the data-days-published or there will be no articles to return.

data-limit

The number of articles you want to show

1 to 100

5

This setting allows you to specify the number of items you’d like to get back on the list. For behaviour in cases where the list does not contain the number of articles requested, see data-force-limit.

data-force-limit

In order to return the appropriate number of results specified in your data-limit setting, the system will look for the next largest data-trend-window window and then next largest data-days-published to fulfill your data-limit request.

true or false

true

This setting automatically cycles the data-trend-window(and, after exhausting interval sizes, it cycles data-days-published as well), until a list is found that contains the number of items requested through data-limit. If this behaviour is turned off, the widget will render with zero or more items, up to data-limit, using only the specified data-trend-window and data-days-published values.

data-realtime

Enable real-time update of content

true or false

true

This will update the list for the user in real time as the list changes and also update the number of comments for that article in real time

data-style

What style of widget to display

full or mini

full

full style will display an article’s description and a larger image when available, in addition to the article’s title. This data is gathering using Open Graph standard tags (og:title, og:description, og:image).


Did this page help you?