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?
Comments
you might try colorbox module
you might try colorbox module as thickbox has no official D7 release
also your inline css will make the whole div display:none (even in thickbox)put this in a block for anonymous users only
wrap the div you want to show in thickbox or whatever overlay module (as i've done above)
and the div you pull into jquery will be visible. also best practice is to make the display:none
call via js so with js turned off, the form is visible.
Hello. How do I render just
Hello. How do I make it render only the "name", "pass" and "submit" elements for example. Not all the elements? Thanks.
you can draw the login form as you wish like this
keep in mind, i have only started working with drupal a month ago.
with that said, in /site/all/themes/[yourtheme]/templates/block--user--login.tpl.php:
cheers.
This works thanks!!
This works thanks!!
--
wOOge | adrianjean.ca