Hi,
It would good to have some label text along with the tick box on login forms - to help visitors understand the implications of ticking it. Should include things like:

  • We'll remember you're logged in for [1 week] so you'll not need to use your password.
  • Don't tick this box if you're on a shared or public computer.

illustrate where the label text should be displayed

Matthew

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

nickl’s picture

Or perhaps a link to an anonymous page / modal seems like an awful lot of text for a login screen.

None the less sounds like a useful addition, well spotted!

@mshepherd please submit patch with your suggestions for review.

mshepherd’s picture

Status: Needs review » Active
FileSize
1.34 KB

Patch attached.

I've shortened the text considerably, but I think it belongs with the tickbox. I've also followed the Drupal core user module convention of only displaying the descriptive text on the page and not on the block.

Also, the system.css file adds a margin-left to the labels of tickboxes, which stopped the text for this tickbox from lining up with the labels of other fields. I've reset this margin in an added css file.

See what you think.

mshepherd’s picture

Assigned: Unassigned » mshepherd
Status: Active » Needs review
FileSize
17.12 KB

For reference, this is how it now looks on a site I'm working on at the moment.

Login page showing new descriptive text

mshepherd’s picture

Status: Active » Needs review

Other suggestions for the text might be (presented in pairs, one if the session lifetime is being managed, one if not):

Currently

  • We'll remember you for 1 week so you won't need your password next time. Untick on a shared computer.
  • We'll remember you so you won't need your password next time. Untick on a shared computer.

Slightly shorter - I think this would be my preference

  • We'll remember you for 1 week so you'll not need to log on next time. Untick on a shared computer.
  • We'll remember you so you'll not need to log on next time. Untick on a shared computer.

Bit shorter again

  • Your login will be remembered for 1 week. Untick on a shared computer.
  • Your login will be remembered. Untick on a shared computer.

If you're generally happy with the other stuff in the patch but would prefer one of these other text strings, let me know & I'll reroll.

Matthew

nickl’s picture

Looking good, well done.

Can we make this configurable? We can leave the string for translation but I may want to enable or disable the display of a tip so a simple checkbox on the settings page will suffice. As much as I agree to the benefit of having the information, and we can display it by default be my guest, personally its not something I would use and looking at the majority of implementations online as example I think others might feel the same.

Can we use arguments for the t function instead and keep the whole string as one complete message? I am just thinking of the headache to try and translate something like " for " when out of context and this will simplify the changing of the content if I prefer to use different wording perhaps.

Try and keep to a 120(max) character width if at all possible, which just makes reading the code so much easier.

Like the style sheet abstraction that's awesome!

mshepherd’s picture

  • Yes, I'll get that tickbox into the settings page to turn the description on & off. I guess I was following the Drupal way - the username and password fields each have descriptive text, which I think is overkill. The text here is providing useful and for some, important information. But you're right, on sites where the majority of users are behind their desk on their PC, this information is probably not necessary, so it's definitely a good idea to have it turn-off-and-on-able.
  • Thanks for the reminder about arguments for the t() function - I knew there was a neater way to do that, but it had completely slipped my mind.
  • Point taken for code width.

I'll get that done asap - most likely over the next 2-3 days.

Thanks.

mshepherd’s picture

Question.

The CSS file will not be necessary if we're not displaying the descriptive text (i.e. it's been turned off). Would it be better then to add the CSS using drupal_add_css() inside remember_me_init(), that way we only need add the CSS if variable remember_me_description_text has been set to 1.

Let me know what you think.

Matthew

mshepherd’s picture

Thought I'd get this done while it was fresh in my mind.

Still open to further changes, incl the CSS thing I mentioned above.

mshepherd’s picture

Slightly more explicit description text for new tickbox on settings page.

mshepherd’s picture

Changed text string slightly for clarity.