1 views.block.inc | ViewsBlock::getTitle() |
Return the title of a block as configured in the layout.
Return value
mixed:
Overrides Block::getTitle
File
- core/
modules/ views/ includes/ views.block.inc, line 230
Class
- ViewsBlock
- Displays a view listing as a block, with overriding options.
Code
function getTitle() {
// Set a custom title in the parent method.
$title = parent::getTitle();
// If no custom title, pull from the View output.
if ($this->settings['title_display'] === LAYOUT_TITLE_DEFAULT) {
$title = $this->viewOutput['subject'];
}
// Link to the view if a path is provided in ViewsBlock::prepare().
if ($title && isset($this->viewOutput['path'])) {
$title = l($title, $this->viewOutput['path'], array('html' => TRUE));
}
return $title;
}