Custom home page plugin

Hi everyone.

I am building a simple custom home page plugin.

elgg 2.3.3

I have changed my elgg advanced setting by enabling the option Restrict pages to logged-in users

I doing something simple in my start.php and I have a simple problem but I dont know how to resolv.

$body = elgg_view("core/account/login_box");

echo elgg_view_page('', $body);

Everything works perfectly but the main menu is displayed in the login page (Menu with Activity, Blogs, etc.)

I have changed my elgg advanced setting by enabling the option Restrict pages to logged-in users so I dont know why that menu is displayed on my custom login page.

Could someone help me I dont want the main menu to be displayed on my custom login page.

Best regard.

 

 

 

 

  • Elgg ToC: It's polite to mention how you do this for people who have the same problem in the future.

  • Sorry for that

    I have used walled_garden and my code looks as followed

    $title = elgg_echo('login');
    
    $content = elgg_view('core/account/login_box', array('title' => false));
    
    
    if (elgg_get_config('walled_garden')) {
    
    elgg_load_css('elgg.walled_garden');
    
    $body = elgg_view_layout('walled_garden', array('content' => $content));
    
    //echo elgg_view_page($title, $body, 'walled_garden');
    
    $loginpanel = elgg_view_page($title, $body, 'walled_garden');
    
    } else {
    
    $body = elgg_view_layout('one_column', array(
    
    'title' => $title,
    
    'content' => $content,
    
    ));
    
    //echo elgg_view_page($title, $body);
    
    $loginpanel = elgg_view_page($title, $body);
    
    }
    
    
    echo $loginpanel ;
     
    Best regard
Beginning Developers

Beginning Developers

This space is for newcomers, who wish to build a new plugin or to customize an existing one to their liking