I'm writing a plugin to support mobile/tablet. For some reasons, my system don't need lots of default features, so I want to unregister all default page handlers and completely rewrite all.
Is there anyway to do that ?
Thank you so much for helping :)
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.
- Brett@brett.profitt
Brett - 0 likes
- Geany@drnoxxx
Geany - 0 likes
- Team Webgalli@webgalli
Team Webgalli - 0 likes
- Geany@drnoxxx
Geany - 0 likes
- Brett@brett.profitt
Brett - 0 likes
You must log in to post replies.Register a handler for the route, all hook and return false to prevent any page handler from being called. You will have to do your own page handling in the handler function.
Can you give me some sample code ? Thank you so much !
Now, this is my code
elgg_register_plugin_hook_handler('route', 'all', 'remove_pg_handlers');
function remove_pg_handlers($hook, $type, $return, $params) {
return false;
}
Now if you want to remove specific page handlers use elgg_unregister_pagehandler()
Great! It worked perfectly! Thank you :)
And now I also want to remove default css and js. I used
It worked but the vendor jquery 1.6.4 is still used. I want to replace it by jquery 1.7.2 or another js library such as mootools, dojo. So how to do it ?
Thank you :)
Use elgg_register_js(). I recommend always reading the inline documentation for functions because it usually points you to related functions. Also, look at the bundled plugins for examples of many of these things.