Drupal Most Popular Features
Ready to Use
The module is pre-packaged with several services including:
- Drupal - Most Viewed pages (using Statistics module)
- Drupal - Most Commented pages (from simple database query)
- Google Analytics - Most Viewed pages (from page tracker)
- AddThis.com - Most Emailed pages (from AddThis widget)
The system defines Drupal hooks to allow new services to be created, which can pull data from third party providers or internally from Drupal. The system also provides an API to help service plugins normalize their results and exclude certain pages, as configured by the administrator.
Themeable User Interface
The module uses cookies to keep track of the user's filters, so the current state is preserved across every page. The module uses AJAX to reload its results when the user changes the filters, but if javascript is disabled, the module provides a fully-functional alternate interface for viewing the most popular nodes.
By default the module comes with three styles ready to use:
- Full styling - for when you'd like the widget to look good right out of the box.
- Basic styling - for when you'd like some default layout styles but plan to override the colors, themes, etc.
- No styling - for user interface experts who wish to completely customize the look and feel of the module.
You can override the themes used to render each component:
- The overall block template (and page template when javascript is disabled).
- The tabs of available services.
- The tabs of available intervals.
- The list of most popular items.
- Each most popular item (so you can add images, publication date, etc).
- The list when there are no items to display.
You can also override the Javascript options to:
- Change the JQuery selectors targeting:
- Drupal Most Popular block.
- Tabs of available services.
- Tabs of available intervals.
- List of most popular content.
- Change the CSS class to attach to the selected service and interval.
- Change the transition animations and behaviors when the content pane is reloading:
- Change the animations used to hide the previous content and show the new content.
- Enable or disable a throbber which appears while the new content is loaded.
Drupal Administration
An administrator can quickly control options and features through the Drupal administration interface:
- Customize the maximum number of results to display.
- Show or hide the number of page hits for most popular items.
- Normalize the page URLs that are returned from external services:
- Add multiple domains or base URLs.
- Exclude certain pages from the most popular results.
- Customize the intervals over which filtering is available, the label for each interval and the order in which they are presented.
- Customize which services are available, the label for each service and the order in which they are presented.
- Configure each service, provide login credentials if necessary, and specify how often the service should retrieve its data.
While it is possible to include more than one Drupal Most Popular block on a page, the configuration options apply to all Drupal Most Popular blocks. It is not currently possible to configure blocks individually.
Scalability and Performance
Many third party providers specify quotas limiting how many times you can query their service within a certain period of time. With the Drupal Most Popular module, you can specify a different wait period for each of the intervals over which each service is to receive data. For example, you likely want to refresh data for the past 24 hours more frequently than data for the past year. Each service can choose to specify defaults based on the currently-configured filter intervals, and the adminstrator can override these intervals if necessary.
Data is retreived when the Drupal cron job runs and is cached locally. The Drupal Most Popular module keeps track of the last time a service was run and does not request data from that service again until the configured refresh interval has passed. However, the administrator can choose to expire all the data manually and retrieve it again immediately.
To maximize the speed at which pages load, the Drupal Most Popular block includes its initial content inline on the page and only uses AJAX if the user changes their filters. If the Authcache module is enabled, the Drupal Most Popular block loads its initial content through AJAX instead so it can preserve the user's current filters.
Additional Notes
The Drupal Most Popular module is highly customizable, so you’re not limited to the features above. If you’d like to add a new feature you are welcome to do so. For additional details, please read the documentation.
