You are here

README.txt in Mobile Switch Block 6

Same filename in this branch
  1. 6 README.txt
  2. 6 templates/mobile_jquery/README.txt
Same filename and directory in other branches
  1. 7.2 README.txt
  2. 7 README.txt
Mobile Switch Block module

Extends the Mobile Switch module with an theme switch block.

The block content provides a link to manually switch the current theme to
the mobile or desktop theme.

HOW IT WORKS
------------

  The module uses a cookie to store the theme was changed to. This works with
  anonymous visitors and logged in users.

DEPENDENCIES
------------

  - Drupal 6.
  - The Mobile Switch module from drupal.org/project/mobile_switch.
    NOTE: It is required to use the
          - 6.x-1.0-beta1+ version or
          - latest development version
          of the Mobile Switch module.

INSTALL
-------

  1) Copy the Mobile Switch Block folder to the modules folder in
     your installation. Usually this is sites/all/modules.
     Or use the UI and install it via admin/modules/install.

  2) In your Drupal site, enable the module under Administer -> Site building.
     /admin/build/modules

  Note:
  Install/enable the module only if you want to use the manual switch function!

ADMINISTER
----------

  Administer blocks under:
  Administer -> Site building
  /admin/build/block

    - Enable the 'Mobile Switch' block in the desktop theme.
    - Enable the 'Mobile Switch' block in the mobile theme.

    - Configure one of the "Mobile Switch" blocks.
      Choose the option to display the block content. The same configuration
      option exists in the Advanced module administration.

  Administer the Mobile Switch 'Advanced' settings under:
  Administer -> Site configuration -> Mobile Switch
  admin/settings/mobile-switch/advanced

    - Configure the output of the switch content.

    - Configure the 'Cookie lifetime' when needed.

      Lifetime examples:

      31536000 - 1 year (default)
      2628000  - 30 days
      604800   - 1 week
      86400    - 24 hours

DEVELOPMENT
-----------

  Don't forget to take a look at the 'Development' funtions in the Mobile Switch
  module settings.
  As example, it is usefull to enable the 'Desktop browser' option.

  Development with Mobile Switch Block.

  1) The module provides the system variable:

     theme_cookie

     - The default value of this variable is FALSE. If the theme switch cookie
       exists the value can be 'standard' or 'mobile'.

  2) Use the block content. Example PHP code to do this:

     print mobile_switch_block_get_block_content();

     In this use case, you ensure that the switch link content appears only
     with mobile devices.

  3) Use the switch block only on large mobile devices:

     It is possible to use media queries to hide the block on small mobile
     devices. Example CSS code to do this:

     @media screen and (max-device-width: 600px) {
       #block-mobile-switch-block-switch {
         display: none;
       }
     }

     More media query examples:
     http://webdesignerwall.com/tutorials/css3-media-queries

     Note: Take a look at the Respond.js module.
           drupal.org/project/respondjs

           This module provides IE 6-8 support for responsive themes.
           It uses Respond.js, delivering lightweight, fast support for
           min-width and max-width CSS3 media queries.

THEMING
-------

  Module template
  ---------------

     The module comes with a template file, included in the module folder.

     mobile-switch-block-content.tpl.php

     Is used for the switch content - the switch link and the switch message.

  Use of the template
  -------------------

     This requires that there is a mobile-switch-block-content.tpl.php template
     in the desktop and/or mobile theme folder.

  Switch link without menu bullet
  -------------------------------

    Remove in the template/s the class 'leaf' from the list tag.

    

      <li class="even first last">
    
This will work with most themes and is recommended rather than an additional CSS formatting. Usage with a 'Mobile jQuery' theme ---------------------------------- Mobile jQuery Theme, drupal.org/project/mobile_jquery To obtain a 'Mobile jQuery' like output of the switch link, create a template file for the Mobile jQuery theme from the desktop template file 'mobile-switch-block-switch-content.tpl.php' with the same name and put this new template file in the 'templates' folder. Example path for the new Mobile jQuery theme template file: /sites/all/themes/mobile_jquery/templates/ In the new template file replace the code

     <?php if ($switch_message): ?>
       <?php print $switch_message ?>
     <?php endif;?>
       <ul class="menu clearfix">
         <li class="leaf even first last">
           <?php print $switch_link ?>
         </li>
       </ul>
    
with the following code

    <?php print $content ?>
    
It is therefore possible to use different templates in the desktop and mobile Theme. Note: Take a look at the Mobile Switch Block module folder templates/mobile_jquery/.

File

README.txt
View source
  1. Mobile Switch Block module
  2. Extends the Mobile Switch module with an theme switch block.
  3. The block content provides a link to manually switch the current theme to
  4. the mobile or desktop theme.
  5. HOW IT WORKS
  6. ------------
  7. The module uses a cookie to store the theme was changed to. This works with
  8. anonymous visitors and logged in users.
  9. DEPENDENCIES
  10. ------------
  11. - Drupal 6.
  12. - The Mobile Switch module from drupal.org/project/mobile_switch.
  13. NOTE: It is required to use the
  14. - 6.x-1.0-beta1+ version or
  15. - latest development version
  16. of the Mobile Switch module.
  17. INSTALL
  18. -------
  19. 1) Copy the Mobile Switch Block folder to the modules folder in
  20. your installation. Usually this is sites/all/modules.
  21. Or use the UI and install it via admin/modules/install.
  22. 2) In your Drupal site, enable the module under Administer -> Site building.
  23. /admin/build/modules
  24. Note:
  25. Install/enable the module only if you want to use the manual switch function!
  26. ADMINISTER
  27. ----------
  28. Administer blocks under:
  29. Administer -> Site building
  30. /admin/build/block
  31. - Enable the 'Mobile Switch' block in the desktop theme.
  32. - Enable the 'Mobile Switch' block in the mobile theme.
  33. - Configure one of the "Mobile Switch" blocks.
  34. Choose the option to display the block content. The same configuration
  35. option exists in the Advanced module administration.
  36. Administer the Mobile Switch 'Advanced' settings under:
  37. Administer -> Site configuration -> Mobile Switch
  38. admin/settings/mobile-switch/advanced
  39. - Configure the output of the switch content.
  40. - Configure the 'Cookie lifetime' when needed.
  41. Lifetime examples:
  42. 31536000 - 1 year (default)
  43. 2628000 - 30 days
  44. 604800 - 1 week
  45. 86400 - 24 hours
  46. DEVELOPMENT
  47. -----------
  48. Don't forget to take a look at the 'Development' funtions in the Mobile Switch
  49. module settings.
  50. As example, it is usefull to enable the 'Desktop browser' option.
  51. Development with Mobile Switch Block.
  52. 1) The module provides the system variable:
  53. theme_cookie
  54. - The default value of this variable is FALSE. If the theme switch cookie
  55. exists the value can be 'standard' or 'mobile'.
  56. 2) Use the block content. Example PHP code to do this:
  57. print mobile_switch_block_get_block_content();
  58. In this use case, you ensure that the switch link content appears only
  59. with mobile devices.
  60. 3) Use the switch block only on large mobile devices:
  61. It is possible to use media queries to hide the block on small mobile
  62. devices. Example CSS code to do this:
  63. @media screen and (max-device-width: 600px) {
  64. #block-mobile-switch-block-switch {
  65. display: none;
  66. }
  67. }
  68. More media query examples:
  69. http://webdesignerwall.com/tutorials/css3-media-queries
  70. Note: Take a look at the Respond.js module.
  71. drupal.org/project/respondjs
  72. This module provides IE 6-8 support for responsive themes.
  73. It uses Respond.js, delivering lightweight, fast support for
  74. min-width and max-width CSS3 media queries.
  75. THEMING
  76. -------
  77. Module template
  78. ---------------
  79. The module comes with a template file, included in the module folder.
  80. mobile-switch-block-content.tpl.php
  81. Is used for the switch content - the switch link and the switch message.
  82. Use of the template
  83. -------------------
  84. This requires that there is a mobile-switch-block-content.tpl.php template
  85. in the desktop and/or mobile theme folder.
  86. Switch link without menu bullet
  87. -------------------------------
  88. Remove in the template/s the class 'leaf' from the list tag.
  89. @code
  90. @endcode
  91. This will work with most themes and is recommended rather than an additional
  92. CSS formatting.
  93. Usage with a 'Mobile jQuery' theme
  94. ----------------------------------
  95. Mobile jQuery Theme, drupal.org/project/mobile_jquery
  96. To obtain a 'Mobile jQuery' like output of the switch link, create a
  97. template file for the Mobile jQuery theme from the desktop template file
  98. 'mobile-switch-block-switch-content.tpl.php' with the same name and put this
  99. new template file in the 'templates' folder. Example path for the new
  100. Mobile jQuery theme template file:
  101. /sites/all/themes/mobile_jquery/templates/
  102. In the new template file replace the code
  103. @code
  104. @endcode
  105. with the following code
  106. @code
  107. @endcode
  108. It is therefore possible to use different templates in the desktop and
  109. mobile Theme.
  110. Note: Take a look at the Mobile Switch Block module folder
  111. templates/mobile_jquery/.