Overriding views is a little like forking: you don't get upstream core/plugin changes. In Elgg 1.8+ you can alter views--to do more surgical alterations--after they've been rendered. You do this using the "view" plugin hook.
Example: remove breadcrumbs that have no links
// arguments are 'view', the view name, and your handler callback
elgg_register_plugin_hook_handler('view', 'navigation/breadcrumbs', 'myPlugin_alter_breadcrumbs');
function myPlugin_alter_breadcrumbs($hook, $type, $returnValue, $params) {
// $hook is 'view', $type is the view name, $returnValue is the string
// output of the view, and $params['viewtype'] has the view type.
if ($params['viewtype'] === 'default') {
if (false === strpos($returnValue, '<a ')) {
$returnValue = ''; // if no link, remove completely
}
}
return $returnValue;
}
info@elgg.org
Security issues should be reported to security@elgg.org!
©2014 the Elgg Foundation
Elgg is a registered trademark of Thematic Networks.
Cover image by RaĆ¼l Utrera is used under Creative Commons license.
Icons by Flaticon and FontAwesome.