You are here

README.txt in ThemeKey 7

ThemeKey
========

Name: themekey
Authors: Markus Kalkbrenner | Cocomore AG
         Carsten Müller | Cocomore AG
         Christian Spitzlay | Cocomore AG
         Thilo Wawrzik <drupal at profix898 dot de>
Drupal: 7.x
Sponsor: Cocomore AG - http://www.cocomore.com
                     - http://drupal.cocomore.com

Description
===========

ThemeKey is meant to be a generic theme switching module. It
allows you to switch the theme for different paths and based
on object properties (e.g. node field values). It can also be
easily extended to support additional paths or properties as
exposed by other modules.

Documentation for users and developers is very sparse at the
moment. I hope to complete the docs in the next few weeks.
Thanks for your patience :)


Installation
============

1. Place whole themekey folder into your Drupal modules/ or better
   sites/x/modules/ directory.

2. Enable the ThemeKey module by navigating to
     Configuration > Modules

3. Bring up themekey configuration screens by navigating to
     Configuration > User Interface / ThemeKey


ThemeKey UI
===========

1. Enable the ThemeKey UI module by navigating to
     Configuration > Modules

2. Bring up ThemeKey configuration screens by navigating to
     Configuration > User Interface / ThemeKey > Settings > User Interface


For Developers
==============

HOOK_themekey_properties()
  Attributes
    Key:    namespace:property
    Value:  array()
            - description => Readable name of property (required)
            - validator   => Callback function to validate a rule starting with that property (optional)
                             TODO: describe validator arguments and return value 
            - file        => File that provides the validator function (optional)
            - path        => Alternative path relative to dupal's doc root to load the file (optional)
            - static      => true/false, static properties don't occur in properties drop down
                             and have fixed operator and value (optional)
            - page cache  => Level of page caching support:
                             - THEMEKEY_PAGECACHE_SUPPORTED
                             - THEMEKEY_PAGECACHE_UNSUPPORTED
                             - THEMEKEY_PAGECACHE_TIMEBASED
                             Default is THEMEKEY_PAGECACHE_UNSUPPORTED (optional)

  Maps
    Key:    none (indexed)
    Value:  array()
            - src       => Source property path (required)
            - dst       => Destination property path (required)
            - callback  => Mapping callback function (required)
            - file      => File that provides the callback function (optional)
            - path      => Alternative path relative to dupal's doc root to load the file (optional)
            - args      => array of additional arguments to be passed to the callback function (optional)

HOOK_themekey_global()
  Global properties
    Key:    namespace:property
    Value:  property value (scalar value or array of scalar values)

HOOK_themekey_paths()
  Paths
    Key:    none (indexed)
    Value:  array()
            - path      => Router path to register (required)
            - callbacks => Load (and/or match) callback (optional)
              (the callback function can set the 'theme' element in $params array directly, which will be applied)
              Callback arguments:
              - $item:    array of elements associated with the path/callback
              - $params:  array of parameters available for load callback

File

README.txt
View source
  1. ThemeKey
  2. ========
  3. Name: themekey
  4. Authors: Markus Kalkbrenner | Cocomore AG
  5. Carsten Müller | Cocomore AG
  6. Christian Spitzlay | Cocomore AG
  7. Thilo Wawrzik
  8. Drupal: 7.x
  9. Sponsor: Cocomore AG - http://www.cocomore.com
  10. - http://drupal.cocomore.com
  11. Description
  12. ===========
  13. ThemeKey is meant to be a generic theme switching module. It
  14. allows you to switch the theme for different paths and based
  15. on object properties (e.g. node field values). It can also be
  16. easily extended to support additional paths or properties as
  17. exposed by other modules.
  18. Documentation for users and developers is very sparse at the
  19. moment. I hope to complete the docs in the next few weeks.
  20. Thanks for your patience :)
  21. Installation
  22. ============
  23. 1. Place whole themekey folder into your Drupal modules/ or better
  24. sites/x/modules/ directory.
  25. 2. Enable the ThemeKey module by navigating to
  26. Configuration > Modules
  27. 3. Bring up themekey configuration screens by navigating to
  28. Configuration > User Interface / ThemeKey
  29. ThemeKey UI
  30. ===========
  31. 1. Enable the ThemeKey UI module by navigating to
  32. Configuration > Modules
  33. 2. Bring up ThemeKey configuration screens by navigating to
  34. Configuration > User Interface / ThemeKey > Settings > User Interface
  35. For Developers
  36. ==============
  37. HOOK_themekey_properties()
  38. Attributes
  39. Key: namespace:property
  40. Value: array()
  41. - description => Readable name of property (required)
  42. - validator => Callback function to validate a rule starting with that property (optional)
  43. TODO: describe validator arguments and return value
  44. - file => File that provides the validator function (optional)
  45. - path => Alternative path relative to dupal's doc root to load the file (optional)
  46. - static => true/false, static properties don't occur in properties drop down
  47. and have fixed operator and value (optional)
  48. - page cache => Level of page caching support:
  49. - THEMEKEY_PAGECACHE_SUPPORTED
  50. - THEMEKEY_PAGECACHE_UNSUPPORTED
  51. - THEMEKEY_PAGECACHE_TIMEBASED
  52. Default is THEMEKEY_PAGECACHE_UNSUPPORTED (optional)
  53. Maps
  54. Key: none (indexed)
  55. Value: array()
  56. - src => Source property path (required)
  57. - dst => Destination property path (required)
  58. - callback => Mapping callback function (required)
  59. - file => File that provides the callback function (optional)
  60. - path => Alternative path relative to dupal's doc root to load the file (optional)
  61. - args => array of additional arguments to be passed to the callback function (optional)
  62. HOOK_themekey_global()
  63. Global properties
  64. Key: namespace:property
  65. Value: property value (scalar value or array of scalar values)
  66. HOOK_themekey_paths()
  67. Paths
  68. Key: none (indexed)
  69. Value: array()
  70. - path => Router path to register (required)
  71. - callbacks => Load (and/or match) callback (optional)
  72. (the callback function can set the 'theme' element in $params array directly, which will be applied)
  73. Callback arguments:
  74. - $item: array of elements associated with the path/callback
  75. - $params: array of parameters available for load callback