Drupal Themes Mission Statement

In some Drupal Themes there is support for displaying the "Mission Statement" across all pages and in others this support is limited to the "Front Page" or "Main Page".

If you are ever using one of the themes with limited mission statement support and want to display the mission statement across all pages you can use this to do so.

In template.php add the following to the bottom of the file:

function _phptemplate_variables($hook, $vars = array()) {
// Make custom variables available to theme templates
switch ($hook) {
// Send new variable $custom_mission to page.tpl.php
case 'page':
$vars['custom_mission'] = variable_get('site_mission', '');
break;
}
return $vars;
}

Then in page.tpl.php change:

<?php if ($mission) { ?><?php print $mission ?><?php } ?>
to be

<?php if ($custom_mission) { ?><?php print $custom_mission ?><?php } ?>

These 2 changes should allow the "Mission Statement" to be displayed across all pages.

Simpler approach: in

Simpler approach:
in template.php from your example, just change

$vars['custom_mission'] = variable_get('site_mission', '');

into

$vars['mission'] = variable_get('site_mission', '');

and you don't need to change anything in other files.

Copyright 2002-2008 Damage Studios