23 lines
538 B
Plaintext
23 lines
538 B
Plaintext
<?php
|
|
|
|
/**
|
|
* @file
|
|
* Functions to support theming in the S.I.S Can Tho theme.
|
|
*/
|
|
|
|
/**
|
|
* Implements hook_preprocess_HOOK() for page templates.
|
|
*/
|
|
function sis_theme_preprocess_page(&$variables) {
|
|
// Pass dynamic front page URL
|
|
$variables['front_page'] = \Drupal::urlGenerator()->generateFromRoute('<front>');
|
|
|
|
// Try to determine if the current page is the front page
|
|
try {
|
|
$variables['is_front'] = \Drupal::service('path.matcher')->isFrontPage();
|
|
}
|
|
catch (\Exception $e) {
|
|
$variables['is_front'] = FALSE;
|
|
}
|
|
}
|