1 of 1 found this page helpful

Add text to the Special:UserLogin Page

    Based off of the Special Page tutorial, I threw together a quick sample of adding text to a login page to inform your users about necessary information. 

     

    Create a new directory for your Special page

    Linux

    mkdir /var/www/dekiwiki/deki/plugins/special_page/special_userlogin_custom

    Windows

    Create a new folder named special_userlogin_custom in the following location

    C:\Program Files\MindTouch\MindTouch\deki\plugins\special_page

     

    Add the files

    Once you have created the directory then create a file named: special_userlogin_custom.php and place it in the special_userlogin_custom directory.  Create the file with the following information:

    <?php
    if (defined('MINDTOUCH_DEKI')) :
    DekiPlugin::registerHook(Hooks::SPECIAL_USER_LOGIN, 'wfSpecialUserLoginCustom', 10);
    
    function wfSpecialUserLoginCustom($pageName, &$pageTitle, &$html, &$subhtml)
    {
    	$html = '<p style="float:right">Content is BEFORE the default registration info<br /> Here is the 2nd line of text</p>' . $html;
    }
    
    endif;

     

    Edit your LocalSettings.php file and add the following line:

     

    $wgDekiSpecialPages[] = 'special_userlogin_custom';
     

     Then visit http://yourwiki/Special:UserLogin

    You will then be able to see the content that is referenced as $html above.  You can edit the content and refresh the page to see the formatting.  To keep this example simple I used inline styles, but you are more than welcome to reference a css file as explained in the documentation. Note that the text will not wrap by default, so you will need to inject line breaks or format it accordingly with CSS.

    Was this page helpful?
    Tag page
    You must login to post a comment.

    Copyright © 2011 MindTouch, Inc. Powered by