Direct 'Registration' link on the collapsible login line for usability improvement
levavie - February 28, 2008 - 03:57
| Project: | LoginToboggan |
| Version: | 7.x-1.x-dev |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | needs work |
Description
In certain communities, 90% of the people want to register.
Why force them to open the collapsible block?
Isn't it better to allow them to directly click the registration link?
e.g
Amnon
-
Professional: Drupal Israel | Drupal Development & Consulting | Eco-Healing | Effective Hosting Strategies | בניית אתרים
Personal: Hitech Dolphin: Regain Simple Joy :)

#1
Here is a patch which does it - please review!
This will save the user tons of confusion and improve usability by removing a step in the way.
I've created two new functions,
theme_lt_login_only_link()andtheme_lt_register_link()which does the trick, then called them from_logintoboggan_toggleboggan(), instead of callingtheme_lt_login_link()It was needed to create a new function,
theme_lt_login_only_link(), instead oftheme_lt_login_link(), becausetheme_lt_login_link()is also called from line 178 of hook_form - I didn't understand what it means so I've left it outQuestion: Would you explain what it means?
<?phpif (($form_id == 'user_login_block')) {
$block_type = variable_get('toboggan_block_type', 1);
if ($block_type == 1) {
$form = array('#value' => l(theme('lt_login_link'), 'user/login', array(), drupal_get_destination()));
}
elseif ($block_type == 2) {
$form = _logintoboggan_toggleboggan($form);
}
?>
#2
so...
i'm not taking new features for 5.x -- this would need to be re-rolled for 6.x if you want it in the module.
for 5.x, you can certainly just override the theming function in your theme, ie:
function [yourthemename]_lt_login_link() {...
}
you should only conditionally add the call to l() for the registration link if user registration is enabled -- in other words, move your logic for that from the theme function to the block function.
the code in hook_form_alter() is what alters the standard login block to enable logintoboggan functionality. the other call to the theming function themes the 'login link' option.
#3
#4
No, I can't!
If you re-architect the function to return the full link, it would be possible to do so. But currently. I can't.
This is a design issue. The function only allows me to theme the link text, not split it to two links.
Agreed - I am moving this issue to the D6 version
#5
ah, good point, since the link is generated outside of the theming function. well, let's fix it in 6 then :)
i'll happily review a patch which implements it well.
#6
hello hunmonk and others - was this rolled into the d6 version yet?
#7
@zilla: any updates to this issue will be posted to this issue. you only need to monitor the issue.
#8
I've submitted a patch that might be more acceptable to be included in the Drupal 5 version. It addresses the issue that levavie points out in #4. This would simply move the HTML generation of the expandable div into a theme call. This would allow the type of modification you would like in your theme code.
#9
maybe the most reasonable solution here is to put the entire link structure in the theme function. normally i wouldn't like to do this, but it seems the cleanest solution available for the challenge.
again, any patch should be against 6.x
thanks