Created
March 14, 2019 12:18
-
-
Save andy-blum/17e191ebdc0bcd2e5e946f4234b388ba to your computer and use it in GitHub Desktop.
My frequent preprocess additions
This file contains 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
/** | |
* Implements template_preprocess(). | |
*/ | |
function theme_preprocess(&$variables) { | |
/* Set variables to icon library */ | |
$variables['icons'] = '/themes/custom/THEME/assets/icons'; | |
$variables['brand_ico'] = '/themes/custom/THEME/assets/icons/brands.svg'; | |
$variables['light_ico'] = '/themes/custom/THEME/assets/icons/light.svg'; | |
$variables['regular_ico'] = '/themes/custom/THEME/assets/icons/regular.svg'; | |
$variables['solid_ico'] = '/themes/custom/THEME/assets/icons/solid.svg'; | |
/* Set variables to path & path arguments */ | |
$variables['path_info']['full'] = \Drupal::request()->getPathInfo();; | |
$variables['path_info']['args'] = explode('/', trim($variables['path_info']['full'], '/')); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment