You can override existing pages. Forexample you wanted to override group page handler. But you don't wanted to modify core files (which is recomeneded to not to override files) you can us this hook. `true` means halt the existing view. Example

https://github.com/opensource-socialnetwork/opensource-socialnetwork/issues/1746

~~~
<?php
function override_group_page(){
ossn_add_hook('page', 'override:view', 'override_page');
}
function override_page($hook, $type, $return, $params){
//this means only halt viewing the group edit page and not to effect other pages.
if(isset($params['handler']) && !empty($params['handler']) && $params['handler'] == 'group' && $params['page'][1] == 'edit'){
return true;
}
return false;
}
ossn_register_callback('ossn', 'init', 'override_group_page');
~~~

This need to be used in combination of https://www.opensource-socialnetwork.org/documentation/view/5584/page-load

So things beome like this

~~~
<?php
function override_group_page(){
ossn_add_hook('page', 'load', 'new_group_page');
ossn_add_hook('page', 'override:view', 'override_page');
}
function override_page($hook, $type, $return, $params){
if(isset($params['handler']) && !empty($params['handler']) && $params['handler'] == 'group' && $params['page'][1] == 'edit'){
return true;
}
return false;
}
function new_group_page($hook, $type, $return, $params){
if(isset($params['handler']) && !empty($params['handler']) && $params['handler'] == 'group' && $params['page'][1] == 'edit'){
$id = $params['page'][0];
echo 'new stuff';
}
}
ossn_register_callback('ossn', 'init', 'override_group_page');
~~~

Page override view