Created
May 9, 2016 17:01
-
-
Save willaalt/e52e1b6b14a03467bba764530522b00d 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
| <?php | |
| /** | |
| * @file | |
| * Contains a pre-process hook for 'html'. | |
| */ | |
| /** | |
| * Implements hook_preprocess_html(). | |
| */ | |
| function nb_omega_preprocess_html(&$variables, $hook) { | |
| $product = nbbase_get_query(NBBASE_PARAM_PRODUCT, ''); | |
| $product_name = NULL; | |
| // Check if product exists and if product info is set | |
| if (user_is_logged_in() && !empty($product)) { | |
| $product_info = nbbase_get_current_product_info(); | |
| if (isset($product_info)) { | |
| $product_name = $product_info->name; | |
| } | |
| } | |
| // Display title | product name | site name | |
| // if not then title | site name | |
| if (!empty($product_name)) { | |
| $variables['head_title'] = implode(' | ', array(drupal_get_title(), $product_name, variable_get('site_name'))); | |
| } else { | |
| $variables['head_title'] = implode(' | ', array(drupal_get_title(), variable_get('site_name'))); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment