Coz you hasn't using elgg_view_layout() and form view
Just look at custom index construction:
//grab the login form
$login = elgg_view("core/account/login_box");
// lay out the content
$params = array(
'login' => $login,
);
$body = elgg_view_layout('custom_index', $params);
echo elgg_view_page('', $body);
I also struggled for the same thing for 3-4 days and then finally found a solution.
1. On top of your php file add the following code:
$system_messages = _elgg_services()->systemMessages->dumpRegister();
system_messages(null, "");
2. Now add the following code where you want to display the error message:
if (isset($system_messages['error'])) {
foreach($system_messages['error'] as $sysmsg){
echo "<b><font color='red'>$sysmsg</font><b>";
}
}
if (isset($system_messages['success'])) {
foreach($system_messages['success'] as $sysmsg){
echo "<b><font color='green'>$sysmsg</font></b>";
}
}
Note:
Thanks for your fast response!
My index page is completely a new view and although it might be better to use RVR approach, as I don't have much time to do the index from scratch using elgg views, I have used Rogit Gupta solution.
I will keep in touch for my next doubts or suggestions :)
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.