Setting a Custom Header in a View Using Arguments
In Drupal Views can have a Header or Footer that appear before or after the View. Often one will use this to put in information related to what the view is displaying. However, sometimes you need this information to be context specific. For example you have a View with different terms and you want the header to change based on term the view is being limited to by argument. This is fairly easy to accomplish by adding some PHP code to the header field. Below is an example
<?php
$view = views_get_current_view();
$term = $view-> args[0];
if ($term == ‘Some Term’) {
echo ‘<p>This is the message you want to show for that term</p>’;
}
?>
If you have lots of terms and you want to have specific messages show for each of them then you may want to use switch/case syntax. All and all this is pretty simple trick which allows you to customize the content of your View relatively easily.