Extension Download Message (Popup Alert)


Extension Basics

Title
Download Message (Popup Alert)
Name
ckanext-message
Type
Public extension
Description
Displays popup message or alert to users before downloading resources
CKAN versions

~2.9, ~2.10, ~2.11

Show details
Download-Url (zip)
Download-Url commit date
2025-10-10
Url to repo
Category
Content Management


Background Infos

Description (long)
Show details

Extension that displays a customizable popup message or alert to users before they download resources from CKAN. Allows site administrators to show terms of use, disclaimers, usage guidelines, or important notices that users must acknowledge before accessing downloadable resources. The popup can include custom text, acceptance buttons, and optional user acknowledgment tracking. Useful for ensuring users are aware of licensing terms, data quality notices, privacy considerations, or usage restrictions before downloading datasets. Helps with legal compliance and user education.

Version
0.0.1
Version release date
2025-10-10
Contact name
Andie Yam
Contakt email
Contact Url
(not set)


Installation Guide

Configuration hints

Requirements: - CKAN 2.5+ - Python 2.6 or 2.7 - JavaScript enabled in user browsers

Installation:

  1. Activate CKAN virtualenv: . /usr/lib/ckan/default/bin/activate

  2. Install extension: pip install ckanext-message

    Or from source: git clone https://github.com/yamhochi/ckanext-message.git cd ckanext-message python setup.py develop

  3. Install dependencies: pip install -r dev-requirements.txt

  4. Add plugin to ckan.plugins in production.ini: ckan.plugins = … message …

  5. Restart CKAN: sudo service apache2 reload

Configuration:

Optional configuration settings in production.ini:

Example configuration setting

(optional, default: 24)

ckanext.message.some_setting = some_default_value

Note: Specific configuration options for customizing popup behavior, message content, and display settings should be documented in the extension’s configuration.

Usage:

Popup Message Display:

When users attempt to download a resource:

  1. User clicks resource download link
  2. Popup message appears with configured content
  3. User reads message (terms, disclaimer, notice)
  4. User clicks acceptance button (e.g., “I Agree”, “Continue”)
  5. Download proceeds

Typical Use Cases:

  1. Terms of Use: Display licensing terms and usage conditions before download. Ensure users acknowledge data usage restrictions.

  2. Data Quality Notice: Warn users about data quality issues or limitations. Inform about data currency, accuracy, or completeness.

  3. Privacy Disclaimer: Notify users about personal data in datasets. Remind users of privacy obligations.

  4. Attribution Requirements: Display citation requirements. Show how to properly attribute data sources.

  5. Format Warnings: Warn about file size or special format requirements. Inform about software needed to open files.

Customization:

Customize Popup Content:

Edit message templates to customize: - Message text and formatting - Button labels (“Accept”, “I Agree”, “Continue”, etc.) - Popup styling (colors, size, position) - Additional information links

Example message template:

Terms of Use

By downloading this resource, you agree to:

  • Use the data for lawful purposes only
  • Provide appropriate attribution
  • Not redistribute without permission

Per-Resource Messages:

Configure different messages for different resource types: - PDF resources: format notice - CSV resources: encoding notice - Large files: size warning - Restricted data: access terms

Styling the Popup:

Customize popup appearance with CSS:

.download-message-popup { max-width: 600px; padding: 20px; border: 2px solid #ccc; border-radius: 5px; background: white; box-shadow: 0 4px 6px rgba(0,0,0,0.1); }

.download-message-popup h3 { color: #333; margin-top: 0; }

.download-message-popup button { margin: 10px 5px 0 0; }

JavaScript Behavior:

Customize popup behavior: - Modal vs. inline display - Auto-dismiss after time period - Require scroll to bottom before accept - Remember user acceptance (session/permanent) - Track acceptance for analytics

Development:

  1. Clone repository: git clone https://github.com/yamhochi/ckanext-message.git cd ckanext-message

  2. Install for development: python setup.py develop pip install -r dev-requirements.txt

  3. Create test.ini from template

  4. Run tests: nosetests –nologcapture –with-pylons=test.ini

  5. Run with coverage: pip install coverage nosetests –nologcapture –with-pylons=test.ini –with-coverage –cover-package=ckanext.message –cover-inclusive –cover-erase –cover-tests

Troubleshooting:

  1. Popup not appearing:

    • Verify plugin is in ckan.plugins list
    • Check JavaScript is enabled in browser
    • Inspect browser console for errors
    • Clear browser cache
    • Verify templates are loading
  2. Download proceeding without popup:

    • Check JavaScript event handlers are attached
    • Verify download links have correct class/attributes
    • Check for JavaScript conflicts with other extensions
    • Review browser console for errors
  3. Styling issues:

    • Check CSS is loading correctly
    • Verify no CSS conflicts with theme
    • Inspect element in browser dev tools
    • Clear template cache
  4. Mobile display problems:

    • Ensure popup is responsive
    • Test on various screen sizes
    • Add mobile-specific CSS media queries
    • Consider touch-friendly button sizes

Advanced Features:

User Acknowledgment Tracking:

Optionally track which users have acknowledged messages: - Store acknowledgments in database - Show popup only on first download - Require re-acknowledgment periodically - Track for compliance/audit purposes

Conditional Display:

Show popup based on conditions: - User role (show for anonymous, skip for logged-in) - Resource type (only for specific formats) - Dataset metadata (restricted datasets only) - User’s previous acknowledgments

Multilingual Support:

Provide translated messages: - Use CKAN’s i18n system - Detect user’s language preference - Display popup in appropriate language - Support RTL languages

Accessibility:

Ensure popup is accessible: - Keyboard navigation support - Screen reader compatible - Sufficient color contrast - Focus management - ARIA labels and roles

Integration Examples:

  1. With Terms of Use Extension: Link to full terms document Require acceptance for legal compliance

  2. With Analytics: Track popup views and acceptances Monitor download conversion rates

  3. With Access Control: Different messages for different user roles Integration with restricted access extensions

Best Practices:

  1. Keep messages concise and clear
  2. Use plain language
  3. Provide link to full terms if needed
  4. Make buttons clearly labeled
  5. Test on mobile devices
  6. Consider user experience
  7. Don’t overuse - only for important notices
  8. Ensure legal review for terms/disclaimers

Development Status: Beta (4)

License: AGPL v3.0 or later

Keywords: CKAN, popup, alert, download, message, disclaimer, terms

Developer: Andie Yam / Informed

Related Extensions: - ckanext-termsofuse: Comprehensive terms management - ckanext-reminder: User notifications - ckanext-showcase: Data story presentation

PyPI:

Package available at: https://pypi.python.org/pypi/ckanext-message

Install via pip: pip install ckanext-message

CI/CD: - Travis CI: https://travis-ci.org/yamhochi/ckanext-message - Coveralls: https://coveralls.io/r/yamhochi/ckanext-message

Plugins to configure (ckan.ini)
# message=ckanext.message.plugin:MessagePlugin
CKAN Settings (ckan.ini)
# ckanext.message.some_setting = some_default_value
DB migration to be executed
(not set)
<< back to Extensions