This function is not used for customizing layout. It was originally meant as a way to use a different views system from the one Elgg provides. You almost certainly don't want to do this.
If you're looking to customize layout, I'd read up on views: http://docs.elgg.org/wiki/Views
@iionly , thanks!
I do move the setting file into the correct directory: mod/sc/views/default/admin/, how to how to piont to it in the page_handler!
the original code like this :
function sc_page_handler($page) {
switch ($page[1]) {
case "settings":
//@include(dirname(__FILE__) . "/socialcommerce_settings.php");
@include(dirname(__FILE__) . "/socialcommerce_settings.php");
break;
}}
i think the original 'socialcommerce_settings.php' is a web page,,but once in /views/default/admin/,it is a view. so i do not know what to do?
It's not that easy... at a brief look I can only say this plugin is highly complex. It also seems there's a LOT of work to do to get this working properly in Elgg 1.8. The socialcommerce_settings.php is indeed a page. The page is built up using other views (for example modules/general_settings.php). If I would be working on fixing this plugin I would most likely completely re-model the whole page / views structure of this plugin to be more Elgg-standardish, for example move/modify socialcommerce_settings.php to views/default/admin and make it a view using Elgg 1.8 layouts. This views can be included in the admin section as a menu option using elgg_register_admin_menu_item() in start.php. You also need to modify the pagehandler / pagesetup functions accordingly.
If this is the first plugin you are trying to fix I would suggest to you to either take yourself a lot of time to study the code and compare it a lot to other working plugins for Elgg 1.8 to better understand what you need to change - also constantly referring to http://reference.elgg.org. Or you might better start a bit smaller by working on some simplier plugins first - if the plugin is less complex you will have less problems to solve at the same time and you will be able to fix them one after the other. With the social_commerce plugin you might have to solve many problems first before you even get it running and can test if you solved them successfully.
Thanks, iionly
When you extend a view and you want to add your content above or after this view, you can do that by calling elgg_extend_view() with a third parameter which sets its priority.
- Any number less than 500 (priority < 500) will cause your content to be added before this primary view.
- Any number greater or equal (priority >= 500) will cause your content to be added after this primary view.
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.