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.
Hello. How to customize the login/register block? I am using genesis theme, and I would put the block in the leaderboard. When I do it, i can't see the block. And how to get the items in inline mode. I want to get something like this:
Login | Register (for anonymous users)
Welcome xxxxx: Your account | Logout (for logged users).
I have looking for the code where the block is building but I have no found. Can you help me?
Regards.
Comments
Comment #1
michaelschutz CreditAttribution: michaelschutz commentedHi,
I have the same issue, and have solved it with a short term solution by modifying the module. I know I'm not supposed to do this, but I'm not skilled enough with preprocess functions yet to know if I can override it that way in template.php.
So for now, I simply replaced the HTML markup in ajax_register.module, lines 91-96. I replaced the p and br tags and put everything in a list so that I can theme it in CSS.
Here's the whole function for ease of copy and paste. (again, I know I should be overriding this in template.php, and I plan to learn how to do it properly. Until then, I'll use this hack to get it to work for my purposes). The only changes I made were to replace the p and br tags with the ul and li tags.
This is lines 83-100 inclusive:
One other note on this - if your theme uses the Skinr module, you can set up a CSS class for a basic inline list and then configure this block to appear as an inline list by using a Skinr checkbox.
Hope that helps,
Michael.
Comment #2
compujohnny CreditAttribution: compujohnny commentedYou can override the theming functions in your theme, the new version now supports that
Comment #3
schiavone CreditAttribution: schiavone commentedI'm only seeing four theme functions (function theme_user_login_link, theme_user_register_link, theme_user_logout_link, theme_my_account_link) that could be used in a theme override but none of them can effect the block content. Does anyone have an example of how either $block_content can be overridden or uri variables can be passed for use in a block template?
Comment #4
compujohnny CreditAttribution: compujohnny commentedThe block content consists of these links, so if you override these theme functions you are overriding the block content
Comment #5
crosputni CreditAttribution: crosputni commentedI had no problem getting this to work on the previous version using resolution #1, but now that I've installed the most recent version (1.5), changing the div to ul and whatnot aren't working. I'm kind of a newb with some of this - how would I override the theme functions to display inline?
Thank you in advance for any help.