Home ›
Modifying a view with a views hook: example of custom empty textModifying a view with a views hook: example of custom empty text
Submitted by Benjamin Melançon on December 28, 2007 - 2:12pm
From wsf_action.module:
<?php
/**
* Implementation of hook_views_pre_view
*
*/
function wsf_action_views_pre_view(&$view) { // don't need $items
// in_array($view->name, $place_views)
if (substr($view->name, 0, 6) == 'place_') {
wsf_action_place_view($view);
}
}
function wsf_action_place_view(&$view) {
// work around an apparent bug in views regarding panels
// see
$view->nodes_per_block = $view->pager_limit;
$place_tid = arg(1);
$view->page_empty = wsf_action_place_view_empty($place_tid);
$view->block_empty = wsf_action_place_view_empty($place_tid);
}
function wsf_action_place_view_empty($place_tid = NULL) {
return t('No content of this type yet.');
}
?>
Resolution
Searched words:
hook view
Comments
Other
Other hooks:
http://drupal.org/node/99567
Post new comment