Posted By

emijayne on 07/04/14


Tagged

drupal


Versions (?)

For Changing Drupal Site Name on URL Alias change


 / Published in: PHP
 

simple preprocess function to alter the site name depending on the section of the site

  1. function YOURTHEME_preprocess_page(&$variables, $hook) {
  2. if (theme_get_setting('toggle_name')) {
  3. $path = drupal_get_path_alias();
  4. if (drupal_match_path($path, 'one*')) {
  5. $variables['site_name'] = filter_xss_admin('Site Name One');
  6. } else if (drupal_match_path($path, 'two*')) {
  7. $variables['site_name'] = filter_xss_admin('Site Name Two');
  8. } else if (drupal_match_path($path, 'three*')) {
  9. $variables['site_name'] = filter_xss_admin('Site Name Three');
  10. }
  11. }
  12. }

Report this snippet  

You need to login to post a comment.