file template.php

  1. 7.x-3.x template.php
  2. 7.x-3.x starterkits/THEMENAME/template.php

The primary PHP file for the Drupal Bootstrap base theme.

This file should only contain light helper functions and point to stubs in other files containing more complex functions.

The stubs should point to files within the ./includes folder named after the function itself minus the theme prefix. If the stub contains a group of functions, then please organize them so they are related in some way and name the file appropriately to at least hint at what it contains.

All [pre]process functions, theme functions and template files lives inside the ./templates folder. This is a highly automated and complex system designed to only load the necessary files when a given theme hook is invoked.

Visit this project's official documentation site https://drupal-bootstrap.org or the markdown files inside the ./docs folder.

See Also

  1. <?php
  2. /**
  3. * @file
  4. * The primary PHP file for the Drupal Bootstrap base theme.
  5. *
  6. * This file should only contain light helper functions and point to stubs in
  7. * other files containing more complex functions.
  8. *
  9. * The stubs should point to files within the `./includes` folder named after
  10. * the function itself minus the theme prefix. If the stub contains a group of
  11. * functions, then please organize them so they are related in some way and name
  12. * the file appropriately to at least hint at what it contains.
  13. *
  14. * All [pre]process functions, theme functions and template files lives inside
  15. * the `./templates` folder. This is a highly automated and complex system
  16. * designed to only load the necessary files when a given theme hook is invoked.
  17. *
  18. * Visit this project's official documentation site https://drupal-bootstrap.org
  19. * or the markdown files inside the `./docs` folder.
  20. *
  21. * @see _bootstrap_theme()
  22. */
  23. /**
  24. * Include common functions used through out theme.
  25. */
  26. include_once dirname(__FILE__) . '/includes/common.inc';
  27. /**
  28. * Include any deprecated functions.
  29. */
  30. bootstrap_include('bootstrap', 'includes/deprecated.inc');
  31. /**
  32. * Implements hook_theme().
  33. *
  34. * Register theme hook implementations.
  35. *
  36. * The implementations declared by this hook have two purposes: either they
  37. * specify how a particular render array is to be rendered as HTML (this is
  38. * usually the case if the theme function is assigned to the render array's
  39. * #theme property), or they return the HTML that should be returned by an
  40. * invocation of theme().
  41. *
  42. * @see _bootstrap_theme()
  43. */
  44. function bootstrap_theme(&$existing, $type, $theme, $path) {
  45. bootstrap_include($theme, 'includes/registry.inc');
  46. return _bootstrap_theme($existing, $type, $theme, $path);
  47. }
  48. /**
  49. * Clear any previously set element_info() static cache.
  50. *
  51. * If element_info() was invoked before the theme was fully initialized, this
  52. * can cause the theme's alter hook to not be invoked.
  53. *
  54. * @see https://www.drupal.org/node/2351731
  55. */
  56. drupal_static_reset('element_info');
  57. /**
  58. * Declare various hook_*_alter() hooks.
  59. *
  60. * All hook_*_alter() implementations must live (via include) inside this file
  61. * so they are properly detected when drupal_alter() is invoked.
  62. */
  63. bootstrap_include('bootstrap', 'includes/alter.inc');

Functions

Name Description
bootstrap_theme Implements hook_theme().