You are here

README.txt in Mobile Detect 8.2

Same filename and directory in other branches
  1. 7 README.txt
CONTENTS OF THIS FILE
---------------------

 * Introduction
 * Requirements
 * Installation
 * Configuration
 * Troubleshooting
 * Maintainers


INTRODUCTION
------------

This is a lightweight mobile detection based on the Mobile_Detect.php library,
which can be obtained from the GitHub repository.This module is intended to aid
developers utilizing mobile-first and responsive design techniques who also
have a need for slight changes for mobile and tablet users. An example would be
showing (or hiding) a block or content pane to a particular device.

 * For a full description of the module, visit the project page:
   https://drupal.org/project/mobile_detect

 * To submit bug reports and feature suggestions, or to track changes:
   https://drupal.org/project/issues/mobile_detect


REQUIREMENTS
------------

 * As noted, this module does not include the actual Mobile_Detect library.
   This should be downloaded or cloned from one of the links above and
   placed in:

   sites/all/libraries/Mobile_Detect
   or somewhere the Libraries API (if present) can find it, eg

   sites/default/libraries/Mobile_Detect
   sites/example.com/libraries/Mobile_Detect


INSTALLATION
------------

 * Install as you would normally install a contributed Drupal module. See:
   https://www.drupal.org/docs/8/extending-drupal-8/installing-modules
   for further information.

 * Once the module is installed and enabled, browse to the Status Report
   page (admin/reports/status) and confirm that the library is found. The PHP
   file should have a pathname that is similar to
   sites/all/libraries/Mobile_Detect/Mobile_Detect.php If you think everything
   is installed correctly, you may need to clear the Drupal caches
   (admin/config/development/performance). For testing purposes, the demo.php
   and unit tests included with the library can be deployed, but these should
   not exist on a live production server.

 * Installing using composer to download all libraries required (recommended)

          composer require drupal/mobile_detect


CONFIGURATION
-------------

 * The base module just provides a service for use in themes and other modules:

   $md = \Drupal::service('mobile_detect');
   $md->isMobile();
   $md->isTablet()

 * It adds common Twig extensions to work with html.twig templates:

   {% if is_mobile() %}
   {% if is_tablet() %}
   {% if is_device('iPhone') %}
   {% if is_ios() %}
   {% if is_android_ios() %}

   See the documentation for the Mobile_Detect library for more information.

   Note that the Mobile_Detect considers tablet devices as also being mobile
   devices. When you have both tablet and mobile device selection in use, it is
   best to place the tablet rules first. For example, when using with for Panel
   page selection rules, place the Table variant before the Mobile variant.


TROUBLESHOOTING
---------------

 * Problems with the actual Mobile_Detect library should be directed to the
   GitHub issue queue.

 * Problems with this module and sub-modules should be directed to the Drupal
   issue queue for this project.

  * The "Internal Page Cache" core module assumes that all pages served 
    to anonymous users will be identical, regardless of the implementation 
    of cache contexts.
 
    If you want to use the mobile_detect cache contexts to vary the content 
    served to anonymous users, "Internal Page Cache" must be disabled, 
    and the performance impact that entails incurred.

  * https://www.drupal.org/docs/drupal-apis/cache-api/cache-contexts

MAINTAINERS
-----------

Current maintainers:
 * Darryl Norris (darol100) - https://www.drupal.org/u/darol100
 * Matthew Donadio (mpdonadio) - https://www.drupal.org/u/mpdonadio
 * Sora_tm - https://www.drupal.org/u/sora_tm
 * Viktor Vilyus (VVVi) - https://www.drupal.org/u/vvvi
 * Matt Chapman (chapabu) - https://www.drupal.org/u/chapabu
 * Antonio Martinez (nonom) - https://www.drupal.org/u/nonom

File

README.txt
View source
  1. CONTENTS OF THIS FILE
  2. ---------------------
  3. * Introduction
  4. * Requirements
  5. * Installation
  6. * Configuration
  7. * Troubleshooting
  8. * Maintainers
  9. INTRODUCTION
  10. ------------
  11. This is a lightweight mobile detection based on the Mobile_Detect.php library,
  12. which can be obtained from the GitHub repository.This module is intended to aid
  13. developers utilizing mobile-first and responsive design techniques who also
  14. have a need for slight changes for mobile and tablet users. An example would be
  15. showing (or hiding) a block or content pane to a particular device.
  16. * For a full description of the module, visit the project page:
  17. https://drupal.org/project/mobile_detect
  18. * To submit bug reports and feature suggestions, or to track changes:
  19. https://drupal.org/project/issues/mobile_detect
  20. REQUIREMENTS
  21. ------------
  22. * As noted, this module does not include the actual Mobile_Detect library.
  23. This should be downloaded or cloned from one of the links above and
  24. placed in:
  25. sites/all/libraries/Mobile_Detect
  26. or somewhere the Libraries API (if present) can find it, eg
  27. sites/default/libraries/Mobile_Detect
  28. sites/example.com/libraries/Mobile_Detect
  29. INSTALLATION
  30. ------------
  31. * Install as you would normally install a contributed Drupal module. See:
  32. https://www.drupal.org/docs/8/extending-drupal-8/installing-modules
  33. for further information.
  34. * Once the module is installed and enabled, browse to the Status Report
  35. page (admin/reports/status) and confirm that the library is found. The PHP
  36. file should have a pathname that is similar to
  37. sites/all/libraries/Mobile_Detect/Mobile_Detect.php If you think everything
  38. is installed correctly, you may need to clear the Drupal caches
  39. (admin/config/development/performance). For testing purposes, the demo.php
  40. and unit tests included with the library can be deployed, but these should
  41. not exist on a live production server.
  42. * Installing using composer to download all libraries required (recommended)
  43. composer require drupal/mobile_detect
  44. CONFIGURATION
  45. -------------
  46. * The base module just provides a service for use in themes and other modules:
  47. $md = \Drupal::service('mobile_detect');
  48. $md->isMobile();
  49. $md->isTablet()
  50. * It adds common Twig extensions to work with html.twig templates:
  51. {% if is_mobile() %}
  52. {% if is_tablet() %}
  53. {% if is_device('iPhone') %}
  54. {% if is_ios() %}
  55. {% if is_android_ios() %}
  56. See the documentation for the Mobile_Detect library for more information.
  57. Note that the Mobile_Detect considers tablet devices as also being mobile
  58. devices. When you have both tablet and mobile device selection in use, it is
  59. best to place the tablet rules first. For example, when using with for Panel
  60. page selection rules, place the Table variant before the Mobile variant.
  61. TROUBLESHOOTING
  62. ---------------
  63. * Problems with the actual Mobile_Detect library should be directed to the
  64. GitHub issue queue.
  65. * Problems with this module and sub-modules should be directed to the Drupal
  66. issue queue for this project.
  67. * The "Internal Page Cache" core module assumes that all pages served
  68. to anonymous users will be identical, regardless of the implementation
  69. of cache contexts.
  70. If you want to use the mobile_detect cache contexts to vary the content
  71. served to anonymous users, "Internal Page Cache" must be disabled,
  72. and the performance impact that entails incurred.
  73. * https://www.drupal.org/docs/drupal-apis/cache-api/cache-contexts
  74. MAINTAINERS
  75. -----------
  76. Current maintainers:
  77. * Darryl Norris (darol100) - https://www.drupal.org/u/darol100
  78. * Matthew Donadio (mpdonadio) - https://www.drupal.org/u/mpdonadio
  79. * Sora_tm - https://www.drupal.org/u/sora_tm
  80. * Viktor Vilyus (VVVi) - https://www.drupal.org/u/vvvi
  81. * Matt Chapman (chapabu) - https://www.drupal.org/u/chapabu
  82. * Antonio Martinez (nonom) - https://www.drupal.org/u/nonom