This text and video tutorial will show how the login block may be moved to a separate page in Drupal. This can be desirable for site owners who only allow login access to administrators, not all visitors.Update: this is not the easiest way to hide the login block! Whilst this method works it is probably the long way to do what you need, see the comments at the Webmaster Forums for details.
- Enable Clean URLsThis article assumes Clean URLs are setup on the site. These can be enabled by selecting Administer -> Site Configuration -> Clean URLs from the Drupal side bar menu. The enable option will be blanked out until a test has been run. To run the test click Run the clean URL test: this will ensure Apache has mod_rewrite enabled: something the reader doesn’t need to understand, unless the test fails! If the test does fail, ensure there is a file named .htaccess in the directory where Drupal is installed. If that file is where it should be contact the hosting company, check whether they have mod_rewrite enabled. Alternatively post a question on mod_rewrite to our webmaster forums.The video is in Flash format; as this is a non-Free, and patent enclubered, format not all surfers are able to view it. For these users an OGG video is available.This is a Flash placeholder, please see above for alternate to Flash. Or download Flash from Adobe.
- Enable the Path ModuleThe Path Module must be enabled next. This allows pages created in Drupal to have URLs of the authors choosing, e.g. http://www.example.com/newpage where newpage is chosen by the author. Like all modules, this is enabled via Administer -> Site Building -> Modules from the Drupal side bar menu. Under the group Core – optional search for Path. Check the box next to it and Save configuration to save the changes.As before, this video is in Flash format. An OGG video alternative is also available.This is a Flash placeholder, please see above for alternate to Flash. Or download Flash from Adobe.
- Create a new PageIn this step a static page to hold the login block is created. Select Create Content -> Page from the Drupal side bar menu. Enter ‘Login’ as the title; optionally any text to appear on the page can be added to the Body text field. Expand the URL path settings, enter ‘login’ into the text box. Also expand the Publishing options, ensure Published is set but Promoted to front page is not. Finally click submit to save the changes (alternatively clicking preview shows how the page will look without saving it).As before, this video is in Flash format. An OGG video alternative is also available.This is a Flash placeholder, please see above for alternate to Flash. Or download Flash from Adobe.
- Move the Login Block to newly Created PageAs the new page has been created the Login block may be moved to it. The block administration page can be found under Administer -> Site building-> Blocks. To move the login block to the page created in the previous step find User login in the list of blocks, then click configure.Under Page specific visibility settings select the Show on only the listed pages option, then enter ‘login’ into the Pages text box. ‘login’ is the name of the page where the block should be displayed; more than one page can be listed by pressing return between page names (see the instructions on the block configuration page, underneath the Pages text box for details). Click Save block to complete the changes.When the block is saved Drupal returns to the block listing page, finally the block should be moved from the side bar to the content area of the page. Under Region in the block list are a column of drop-down menus: using the drop-down for User login select Content, then click Save blocks. The login block should have successfully been moved, all that remains is to test the changes: particularly important as hiding the login block would be disastrous!As before, this video is in Flash format. An OGG video alternative is also available.This is a Flash placeholder, please see above for alternate to Flash. Or download Flash from Adobe.
- Test the ChangesImportant: use a different browser for testing! Ensure at least one browser is logged in to Drupal as an administrator in case the setup is incorrect!If a different browser is used for testing, e.g. Opera is logged in as Administrator then use Firefox for testing, it will still be possible to correct any mistakes. The block will not appear for browsers that are logged in, so testing must be conducted using a browser which is not. To test enter the site URL followed by ‘login’, e.g. http://www.example.com/loginAs before, this video is in Flash format. An OGG video alternative is also available.This is a Flash placeholder, please see above for alternate to Flash. Or download Flash from Adobe.
This tutorial only covers moving the login block to its own page, also having a link to the page may also be desirable (amongst other things the reader can probably think of). This can be done by writing a link to /login manually or adding a new menu item (either via editing the login page or through the menu editor Administer -> Site building -> Menus). Unfortunately not everything can be covered in this article. Suggestions for future articles, corrections and comments for this article should be posted at: Webmaster Forums: Moving the Login Block to a Seperate Page in Drupal.