Created
May 13, 2014 17:54
-
-
Save khalib/749a3d828cda6fb51bd4 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <div class="coming-soon"> | |
| <h1><?php print $node->title; ?></h1> | |
| This is a coming soon review | |
| </div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <div class="review"> | |
| <?php if ($is_coming_soon) ?> | |
| <?php print $coming_soon; ?> | |
| <?php endif; ?> | |
| <?php if ($is_module_review) ?> | |
| <?php print $module_review; ?> | |
| <?php endif; ?> | |
| </div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <div class="module-review"> | |
| <h1><?php print $node->title; ?></h1> | |
| This is a module review | |
| </div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| function mymodule_theme { | |
| return array( | |
| 'mymodule_main_page' => array( | |
| 'arguments' => array(), | |
| 'template' => 'templates/main-page', | |
| ), | |
| 'mymodule_coming_soon' => array( | |
| 'arguments' => array('node' => NULL), | |
| 'template' => 'templates/coming-soon', | |
| ), | |
| 'mymodule_module_review' => array( | |
| 'arguments' => array('node' => NULL), | |
| 'template' => 'templates/module-review', | |
| ), | |
| ); | |
| } | |
| function mymodule_preprocess_node(&$variables) { | |
| $node = $variables['node']; | |
| if ($node->type == 'mymodule') { | |
| $variables['is_coming_soon'] = $is_coming_soon; | |
| $variables['is_module_review'] = $is_module_review; | |
| switch ($variables['view_mode']) { | |
| case 'full': | |
| if ($is_coming_soon) { | |
| $variables['coming_soon'] = theme('mymodule_coming_soon', array('node' => $node)); | |
| } else if ($is_module_review) { | |
| $variables['module_review'] = theme('mymodule_module_review', array('node' => $node)); | |
| } | |
| break; | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment