Where and how do I edit the Login Page ?

I have the site set up so only registered logged in user can see ontent, but how can I add an image or some e.g. of content without allowing FULL read access to the site ?

I am using custom index which allows me a nice login page, but when set to allow only logged in users to see content, the default login screen is very bland...

See here any help appreciated just to add the same facebook like image I have here to this login page.

Help appreciated




  • @xhipri09: the loginrequired plugin already does remove the search box from the login page. Basically, it's only one line of code necessary to achieve this:

    elgg_unextend_view('page/elements/header', 'search/header');

    "Basically" means that the loginrequired plugin already does execute this line of code only for logged out visitors. If you want to achieve the same by including the code in another plugin (within the init function of this plugin) you would add:

    if (!elgg_is_logged_in()) {

        elgg_unextend_view('page/elements/header', 'search/header');


    Removing the footer is not something the loginrequired plugin does. It's a bit more complicated (also depending on what exactly you want to remove). If you want to only remove the content shown in the footer (Footer links and logo), you can override the views/default/page/elements/footer.php Elgg core view. You would need to create a copy of this file within your plugin (e,g, the loginrequired plugin) in the same directory substructure, i.e. loginrequired/views/default/page/elements/footer.php or my_custom_plugin/views/default/page/elements/footer.php. Within this copy you would make a modification:

    if(elgg_is_logged_in()) {
    echo elgg_view_menu('footer', array('sort_by' => 'priority', 'class' => 'elgg-menu-hz'));

    $powered_url = elgg_get_site_url() . "_graphics/powered_by_elgg_badge_drk_bckgnd.gif";

    echo '<div class="mts clearfloat float-alt">';
    echo elgg_view('output/url', array(
        'href' => 'http://elgg.org',
        'text' => "<img src=\"$powered_url\" alt=\"Powered by Elgg\" width=\"106\" height=\"15\" />",
        'class' => '',
        'is_trusted' => true,
    echo '</div>';

    Then the content of the footer won't show up anymore for people logged out. The horizontal line above the (now empty) footer still shows up. To remove this line you would need to override another view (don't know which one at the moment).

  • yeah, you re right, this plugin hides everithing :) I´ve tested it desactivating the theme I´m using and see it is correct, but when I activete the theme it come s on the searchbox.. :). The loginrequired plugin is on the bottom of my  plugin admin list, but no problem, I´ll watch where is the problem. Thank you for your always GREAT ANSWERS iionly!


  • It might depend on the theme if the loginrequired plugin works as intended. The loginrequired plugin would need to be below the theme in the plugin list in any case. Otherwise the theme could override the functionality of the loginrequired plugin (at least partly like showing again the search box). Though the loginrequired plugin might also cause the theme not working fully when it's below the theme. This depends on which theme is used. On a simple theme there might be no issues. But if the theme includes some more complex modifications some features might be blocked/changed by the loginrequired plugin. The only way to find out is to test the theme with the loginrequired plugin both enabled and disabled to see the difference. If there's really a conflict that can't be solved with the loginrequired plugin enabled, it might be necessary to merge the loginrequired plugin with the theme plugin (most likely easier this way). Then you can better configure the code to work together without issues.

  • yes iionli, I´ll see what I can do with this.. :) I´ll see how I can merge both plugins. thanks a lot for all ;) !!!