Trending Articles

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"

293293

data-style="mini"

300300

Installation Parameters: Trending Articles

SettingDescriptionAccepted ValuesDefaultNotes
data-titleThe title you want displayed at the top of the plugin
data-sortThe sorting method applied to the articles you want returned commentsShows articles with the most number of commentscomments
data-days-publishedThe 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)
7ddata-days-published must be greater than or equal to the data-trend-window or there will be no articles to return.
data-trend-windowSize of sliding window to use1h, 1d, 3d1hThis 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-limitThe number of articles you want to show1 to 1005This 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-limitIn 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 falsetrueThis 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-realtimeEnable real-time update of contenttrue or falsetrueThis 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-styleWhat style of widget to displayfull or minifullfull 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).