When I installed this module in my custom zen subtheme, it did not go up to the top like it does in garland. I had to make a new region to get it above my logo and when it went in the custom block it didn't show up inline like it does in garland. The 'your account' and 'log out' buttons are below the "hi, welcome back' message. So, why is it's behavior different from theme to theme?

Becky

CommentFileSizeAuthor
#7 userloginbar.module.txt2.73 KBSuzy
#7 userloginbar.css_.txt1.75 KBSuzy

Comments

Fayna’s picture

I had the same problem in my theme, contented07. Might as well do it all in CSS if we must do it for this module to work.

beckyjohnson’s picture

I agree.

Becky

fletort’s picture

I think that each theme should have its own css for this module....

beckyjohnson’s picture

Surely though some generic css could be used to shove the block to the top of the page though, no matter what the theme.

Fayna’s picture

Surely it can be done since the Admin menu module places an administrative bar at the very top and works for all themes.

http://drupal.org/project/admin_menu

enjoy777’s picture

Is there anyone who correct this error? I think not only for solution for one time, but for every template which I can use.

Suzy’s picture

StatusFileSize
new1.75 KB
new2.73 KB

As the module wasn't working properly for me, I basically rewrote a bit of it, and I have a custom css, so I'm hoping to give back a little with this post. This is not really a necessary module as you could just CSS the login block itself however it's very handy for that Welcome message and being able to customise the link text, it's a very easy module to customise ('cos well, if I can do it anyone can!)

I had to totally redo the CSS before I even tweaked the module as I too found it didn't put it all on one line and other spacing was wrong. it turns out there is an error in the module which might be making the CSS a bit funky in some themes, The module, as written, produces 2 x elements with the same ID, and that ID #user-login-form is used in the CSS file provided with the module - So I'm fairly sure it could be that which is causing some of the various theme issues, but I can't remember as I'd stripped out the module sheet and started with a blank slate in my theme (via the theme.info file), I'm more comfortable with CSS so I try CSS tweaks before module code tweaks ;)

{ - sidenote to module maintainer: I don't know enough, but I believe the original module is trying to change the form ID which would correct the duplicate ID problem, but has the wrong value?
should $form['form_id'] be $form['#id'] ?}

First I went to page.tpl.php and changed the code in there to give me an overall controlling ID selector around the entire Block, not just it's content. (my header region is the place I chose to put the block) - I don't think this is actually necessary as you could use the block's ID itself however because it was separate module I wanted to make sure I had an extra ID to ensure any CSS/Theme specificity conflicts would be overruled. Again I don't know if this is what is affecting other themes, but if using just the blockID some themes may already be trying to customise the user login block, so I would guess so.

in page.tpl.php: I added a wrapper div with the ID "userbar"

<div id="wrapper">
<?php if ($header): ?><div id="userbar"><?php print $header; ?></div><?php endif; ?>

I'll attach the tweaked module and my CSS, bear in mind that this CSS is now themed to suit me, but it's very basic white on black, so you could just change the colors to suit, also I haven't themed the input boxes and submit button as I'm not a fan but I've put in blank selectors to show where you would do it. Basically the extra userbar ID used along with the blockID should ensure specificity over any theme, that's the theory anyway

you could try this without tweaking the module if you're happy enough.

The module itself, I removed the div with the ID 'user-login-form' that wraps the content of the block as this is the duplication of the form ID and it is somewhat redundant. Then I removed the form action/id/method (from the form alter function) and only left the links array, That is the only bit, as far as I can tell that is custom for this module, and also the form action as provided by this module is not working properly (doesn't redirect user back to an existing page, in my case), so I don't see it necessary to alter the default form action.. but please do CMIIW!

then in my .info file for my theme I put this:

stylesheets[all][] = style.css
stylesheets[all][] = userloginbar.css

that overrules the default module stylesheet and pulls the userloginbar.css into your themes control, i.e. you place your own custom userloginbar.css inside your theme folder, though it has to have the same name as the module file I believe. OR again you could simply ignore that step and place the .css in the module folder, removing or renaming the original. IF you do just replace the CSS in the module folder, that's where you need to ensure that your CSS is more specific than any other theme, because leaving it in the module folder means it's called before the themes style.css and has a chance of being overruled

Anyway, I made my CSS as specific as possible, with the use of that extra #ID in the page.tpl.php so it *should* override any block defaults regardless of it is called before or after the themes style.css, but I've not left it to chance and have used the .info file override to make it appear after the theme CSS :)

and lastly, if you have block caching enabled in your performance settings, if you haven't already, you might like to try out the Block Cache Alter Module. Using it you can change the caching action of individual blocks so I changed the user login block to "not cache". It's anonymous users that blocks are cached for and a user is anonymous until they login, the form action redirect back to the current page will be cached, and so they will be redirected back to the first page they visited on your site because that's what is in their cache. ;)

OH, and I can't patch modules, but if this version is of any use then the module maintainer can feel free to use it, though I realise the page.tpl.php tweak is not probably not module worthy, This tweak does also fix my earlier Issue in the queue whereby the $form[#action] was not working properly at all

cheers
Suzy

mgladding’s picture

Suzy - Thanks for sharing your solution with the community. This worked perfectly for me using a sub-theme of White Jazz.

socialnicheguru’s picture

does this module not work when logintoboggin is used?

I am not getting the userbar across the top. I am getting a regular form and when I take a look in firefox, it looks like logintoboggin.css is taking over.

but i put the userloginblock block one page.

Thanks for any help you might have.

Chris

btw- i get this with the work above (great work btw- i just wish it worked for me) and the original module

socialnicheguru’s picture

Getting it to work. I had to place the edits in my page.tpl.file.

sammismith’s picture

Thanks Suzy, your posting helped a ton and got it working well with my custom Zen sub-theme.

asb’s picture

Hi,

@ebizondrupalservices (the module's maintiner): Could you please check the fixes from #7 and commit them to HEAD?

Thanks & greetings, -asb

mompadaddy’s picture

LOL.

I made some tweaks to the original module by making changes in the modules/user.css, but I still couldn't get the information (User Name, Password and their fields, etc.) to be in one line. When I saw this post I thought it would be the answer, as I also am using a custom subtheme (of Genesis, not Zen).

Doesn't work for me, and in fact the addition of the code to the page.tpl made it laughable. Genesis has an extra region called a leaderboard, at the top, which is where I want the loginbar.

When I put in the page.tpl.php code, I got TWO log-in blocks - both of them with one element on each line (seven lines deep) - all centered! Doesn't work in the header region either - same formatting.

Thank you for the hard work on this I am not writing to complain at all, just save others from trying to apply it to a Genesis theme.

I think the problem does have something to do with the module not overriding the core modules/user.css. Not sure what the answer is yet for me, but still searching.