Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
By Joekz on
I have a block like this
<li><a href="mywebsite/user/login">Login</a></li>
<li><a href="mywebsite/user/register">Sign In</a></li>
and I want to replace log in with my account when the user logs in and make disappear sign in without using user menu if it's possible.
Thank you
Comments
Use this code
your block is made using custom module ?
--
Naveen Valecha
http://valechatech.blogspot.in
You got those backwards.
You got those backwards.
This will work:
where i put this ?
where i put this ?
I have just a full html block
Thank you
where i put this ?
where i put this ?
I have just a full html block
Thank you
No, just full html block
No, just full html block
No, just full html block
No, just full html block
Enable PHP filter module and
Enable PHP filter module in bock and use php filter to add given php code.
But using php filter is always not recommendable. Instead of adding php code in block, create block programatically.
Use block info hook to create block programatically. In that add your conditions to block body.
http://kahthong.com/2013/06/create-your-own-custom-drupal-block-programm...
r@mmi
Not recommending to use php filter as suggested
Suggested --
U
Agreed 100++
--
Naveen Valecha
http://valechatech.blogspot.in
Goto module section and
Goto module section and enable php filter module. Now come to block section you will see new filter listed there.
You can also use CSS to accomplish this
You can try something like following.