2

I have searched for this for some time and the only thing that pops up is how to create/customize your own login/register page.

I would like to add a link to the default Drupak 7 login/register pages and keep the default Drupal 7 login page (mysite/user) and registration page (myste/user/register). Furthermore, I would also like to add some fields to them.

I am currently using the LoginToboggan module and it has provided some help. Could someone please tell me how I can create a stand alone link that i can theme on the front page that will take a user to login/registration pages?

For example, I would to display something of the following on the front page:

login | register

So both 'login' and 'register' are stand alone links that appears somewhere on the front page and can be themed. but when clicked on, they will take the user to mysite/user (for login) and mysite/user/register (for register)

Thank you any help would be appreciated.

2

You could add a block to your site and have it show up only on the front page

1) add a block -> /admin/structure/block/add 2) add this code in the block

<div id ="new-login-block">
<a href="/user/login">Login</a> | <a href="/user/register">Register</a>
</div>

Make sure that you select a filter that will leave the HTML intact. If you have a rich text editor, make sure that select php code. - http://drupal.org/documentation/modules/filter

3) Set the region settings to show up on top of your content

4) Under Visibility Settings Look for Pages and select only on listed pages

5) In the box, put <front>

6) Save Block

2

Like Stan Ascher posted the simplest and quickest way would probably be to create a block with the links and set it to appear where you want on the front page. With a wysiwyg editor it should be fairly easy to get the output themed to your liking as well.

If adding a block is not suitable for one reason or another there's also the option to manually add the necessary code in your theme's page--front.tpl.php file or if it doesn't exist then page.tpl.php. The code could look like this:

<?php if ($is_front): ?>
<div class="user_links">
  <?php print l(t('login'), 'user', array('attributes' => array('class' => array('login')))); ?>
  <span> | </span>
  <?php print l(t('register'), 'user/register', array('attributes' => array('class' => array('register')))); ?>
</div>
<?php endif; ?>

If the code is going into page--front.tpl.php then remove the first and last line. Basic HTML, CSS knowledge would probably be necessary with this approach though.

You can add fields for users on the 'admin/config/people/accounts/fields' page or select Configuration -> Account settings then the manage fields tab. These can be set to appear on user registration and users can edit them later with their other profile information.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.