Hello, I'm running Elgg 3.3.12 and my plugin is attempting to alter the output of the walled_garden page. I've created a hook that calls back to a function that alters the 'log in' title of the walled_garden page, however I can only access the $vars['title'] by calling:
elgg_register_plugin_hook_handler('view_vars', 'page/layouts/elements/header', 'walled_garden_page');
As I would like to replace the site-name hyperlink and remove the footer of the walled_garden page, I have tried to call:
elgg_register_plugin_hook_handler('view_vars', 'page/walled_garden', 'walled_garden_page');
elgg_register_plugin_hook_handler('view_vars', 'page/elements/walled_garden/header','walled_garden_page');
However, neither of the above returns the value of the $vars['title'] (log in). Is there way to return all the elements used in the walled_garden page?
Thanks in advance.
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.
- Jerome Bakker@jeabakker
Jerome Bakker - 1 like
- views/default/resources/walled_garden.php (the resource)
- views/default/page/walled_garden.php (the layout, here you can remove footer, etc)
- views/default/page/elements/walled_garden/* (different elements in the layout)
- VinceK@vincek
VinceK - 0 likes
- Jerome Bakker@jeabakker
Jerome Bakker - 1 like
- VinceK@vincek
VinceK - 0 likes
- Jerome Bakker@jeabakker
Jerome Bakker - 1 like
You must log in to post replies.why don't you overrule the views? http://learn.elgg.org/en/stable/guides/views.html#overriding-views
Thanks for your speedy response, Jerome. I did what you suggested originally and then I read there was a caveat to that methodology due to long term maintenance.
If it is possible, I would really like to get a grip of those hooks :)
Just out of interest, is there a performance implication in either of the solutions?
What would be the problem? If you override the views in your own plugin (and NOT change the core views) the only problem I can see if we patch something in a view you won't get it.
Since this rarely happens for the core views (mainly in major builds) I don't think this will be a problem.
Hooks add a (tiny) bit of extra execution and therefor performance costs (but it's very very small), overruling the view doesn't add additional execution so no penalty
Thanks again, Jerome. I'll do as you suggest.
I'll have to find another use for those hooks :)
hint: menu items ;)