Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
This module uses the Mobile_Detect library to add Twig extensions related with mobile devices. It's a port I did time ago so credits are going for @mpdonadio
NOTE: This module is now merged with Mobile_detect.
Please switch to Mobile_detect ASAP because we moved to the main project.
Features from this module into Mobile_detect
- Twig extensions
- Php snippets
- Uses composer to bring the MobileDetect library (thanks @sarathkm)
PHP Snippets
$detector = \Drupal::service('mobile_detect');
$detector->isMobile();
$detector->isTablet()
Twig Extensions
{% if is_mobile() %}
{% if is_tablet() %}
Drupal 7.x
Please check https://www.drupal.org/project/mobile_detect
Project information
- Minimally maintained
Maintainers monitor issues, but fast responses are not guaranteed. - Maintenance fixes only
Considered feature-complete by its maintainers. - Module categories: Integrations, Developer Tools
- Ecosystem: Mobile Detect
- 40 sites report using this module
- Created by nonom on , updated
- Stable releases for this project are covered by the security advisory policy.
There are currently no supported stable releases.