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.
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.
Matthew
Comments
Comment #1
nickl CreditAttribution: nickl commentedOr 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.
Comment #2
mshepherd CreditAttribution: mshepherd commentedPatch 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.
Comment #3
mshepherd CreditAttribution: mshepherd commentedFor reference, this is how it now looks on a site I'm working on at the moment.
Comment #4
mshepherd CreditAttribution: mshepherd commentedOther suggestions for the text might be (presented in pairs, one if the session lifetime is being managed, one if not):
Currently
Slightly shorter - I think this would be my preference
Bit shorter again
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
Comment #5
nickl CreditAttribution: nickl commentedLooking 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!
Comment #6
mshepherd CreditAttribution: mshepherd commentedI'll get that done asap - most likely over the next 2-3 days.
Thanks.
Comment #7
mshepherd CreditAttribution: mshepherd commentedQuestion.
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
Comment #8
mshepherd CreditAttribution: mshepherd commentedThought I'd get this done while it was fresh in my mind.
Still open to further changes, incl the CSS thing I mentioned above.
Comment #9
mshepherd CreditAttribution: mshepherd commentedSlightly more explicit description text for new tickbox on settings page.
Comment #10
mshepherd CreditAttribution: mshepherd commentedChanged text string slightly for clarity.