4

Customize template block--user--login.tpl.php

http://drupal.org

I read a lot of how to customize the loginform, but it all does not fit my needs. I am using drupal 7, most of the examples I found are about drupal 6 or previous versions.

I have attached the user login block to the footer menu. But I do not want the hole form to appear, instead I want a link, injected by jQuery to open a thickbox with the form when the user clicks on the link. So I have to create a div with the loginform in it right below the link.

Long prolog, but its very simple if I only could render the form... This is what I have at the moment:

File: block--user--login.tpl.php

<div id="loginform" style="display:none;">
... need the login form here, but the following code does not work
<?php
print render($form['name']); // prints the username field
?>
<?php
print drupal_render($form['pass']); // print the password field
?>
<?php
print drupal_render($form['submit']); // print the submit button
?>
<?php
print drupal_render($form); //print remaining form elements like "create new account"
?>
</div>
<a class="loginlink" href="#loginform"><?php print $block->subject ?></a>

All that works is the linktitle... Can anyone help?

Read »
Created by Dplanet 1 year 1 week ago
Category: Theming   Tags:

PSD to Drupal Theme

Drupal Development

Module Development

Get an Estimate

Tags for Customize template block--user--login.tpl.php

Recent comments