Hello,

I was trying to insert the login block within certain node. I tried to use the following code within the body of the concerned paged and then select php code :

$block = module_invoke('menu', 'block', 'view', 8);// 8 is the block ID of primary link (i did not see the one of login but at least i tried this one and nothing happened)
print $block['content'];

however this code did not work for me. it was actually mentioned that this code works for drupal 5.
anyone with a hint ?

Regards

Comments

briansea’s picture

The following should do it:

global $user;
if (!$user->uid)
{
    print drupal_get_form('user_login_block');
}

ralfph’s picture

hello briansea,

well I inserted this php code into the concerned page and made sure that I select php code but I can see the following after I save:

uid) { print drupal_get_form('user_login_block'); } ?>

any idea ?

Thank you !

ralfph’s picture

briansea’s picture

I generally try to limit the number of modules I use for performance and easy of updating reasons. I tried what I sent on my site and it worked as expected; I'm sorry it didn't for you. Glad you found something that did though. :)