root / drupal7 / sites / all / themes / adaptivetheme / at_core / templates / region.tpl.php @ 74f6bef0
1 | 85ad3d82 | Assos Assos | <?php
|
---|---|---|---|
2 | /**
|
||
3 | * @file
|
||
4 | * Adativetheme region.tpl.php
|
||
5 | *
|
||
6 | * The region template in Adaptivetheme is a little different to most other themes.
|
||
7 | * Instead of hard coding its markup Adaptivetheme generates it in
|
||
8 | * adaptivetheme_process_region(), conditionally printing outer and inner wrappers.
|
||
9 | *
|
||
10 | * This allows the core theme to have just one region template instead of four.
|
||
11 | *
|
||
12 | * You can override this in your sub-theme with a normal region suggestion and use
|
||
13 | * a standard region template if you prefer, or use your own themeName_process_region()
|
||
14 | * function to control the markup.
|
||
15 | *
|
||
16 | * For example, if you prefer a template based approach you can use something
|
||
17 | * like this:
|
||
18 | *
|
||
19 | * @code
|
||
20 | * <?php if ($content): ?>
|
||
21 | * <div class="<?php print $classes; ?>">
|
||
22 | * <div class="region-inner clearfix">
|
||
23 | * <?php print $content; ?>
|
||
24 | * </div>
|
||
25 | * </div>
|
||
26 | * <?php endif; ?>
|
||
27 | * @endcode
|
||
28 | *
|
||
29 | * If you prefer to theme from process functions you can control the markup per
|
||
30 | * region using something similar to this:
|
||
31 | *
|
||
32 | * @code
|
||
33 | * if ($vars['region'] === 'foobar_region') {
|
||
34 | * $vars['outer_prefix'] = '<div class="' . $vars['classes'] . '">';
|
||
35 | * $vars['inner_prefix'] = '<div class="region-inner clearfix">';
|
||
36 | * $vars['inner_suffix'] = '</div>';
|
||
37 | * $vars['outer_suffix'] = '</div>';
|
||
38 | * }
|
||
39 | * @endcode
|
||
40 | *
|
||
41 | * Sidebar Region Template:
|
||
42 | * - You can use a singlular region--sidebar.tpl.php template
|
||
43 | * file to theme both sidebars.
|
||
44 | *
|
||
45 | * Adativetheme variables:
|
||
46 | * - $outer_prefix: Outer div with region classes.
|
||
47 | * - $outer_suffix: Closing element.
|
||
48 | * - $inner_prefix: Inner div with .region-inner and .clearfix classes.
|
||
49 | * - $inner_suffix: Closing div.
|
||
50 | 74f6bef0 | Assos Assos | * - $is_mobile: Mixed, requires the Mobile Detect or Browscap module to return
|
51 | * TRUE for mobile. Note that tablets are also considered mobile devices.
|
||
52 | * Returns NULL if the feature could not be detected.
|
||
53 | * - $is_tablet: Mixed, requires the Mobile Detect to return TRUE for tablets.
|
||
54 | * Returns NULL if the feature could not be detected.
|
||
55 | 85ad3d82 | Assos Assos | *
|
56 | * Available variables:
|
||
57 | * - $content: The content for this region, typically blocks.
|
||
58 | * - $classes: String of classes that can be used to style contextually through
|
||
59 | * CSS. It can be manipulated through the variable $classes_array from
|
||
60 | * preprocess functions. The default values can be one or more of the following:
|
||
61 | * - region: The current template type, i.e., "theming hook".
|
||
62 | * - region-[name]: The name of the region with underscores replaced with
|
||
63 | * dashes. For example, the page_top region would have a region-page-top class.
|
||
64 | * - $region: The name of the region variable as defined in the theme's .info file.
|
||
65 | *
|
||
66 | * Helper variables:
|
||
67 | * - $classes_array: Array of html class attribute values. It is flattened
|
||
68 | * into a string within the variable $classes.
|
||
69 | * - $is_admin: Flags true when the current user is an administrator.
|
||
70 | * - $is_front: Flags true when presented in the front page.
|
||
71 | * - $logged_in: Flags true when the current user is a logged-in member.
|
||
72 | *
|
||
73 | * @see template_preprocess()
|
||
74 | * @see template_preprocess_region()
|
||
75 | * @see template_process()
|
||
76 | * @see adaptivetheme_preprocess_region()
|
||
77 | * @see adaptivetheme_process_region()
|
||
78 | */
|
||
79 | if ($content) { |
||
80 | print $outer_prefix . $inner_prefix . $content . $inner_suffix . $outer_suffix; |
||
81 | } |