Download & Extend

Direct 'Registration' link on the collapsible login line for usability improvement

Project:LoginToboggan
Version:7.x-1.x-dev
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:needs work

Issue Summary

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

Login / Register

Amnon
-
Professional: Drupal Israel | Drupal Development & Consulting | Eco-Healing | Effective Hosting Strategies | בניית אתרים
Personal: Hitech Dolphin: Regain Simple Joy :)

Comments

#1

Title:Have a direct 'register' link on the collapsible login block» Direct 'Registration' link on the collapsible login line for usability improvement
Status:active» needs review

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() and theme_lt_register_link() which does the trick, then called them from _logintoboggan_toggleboggan(), instead of calling theme_lt_login_link()

It was needed to create a new function, theme_lt_login_only_link(), instead of theme_lt_login_link(), because theme_lt_login_link() is also called from line 178 of hook_form - I didn't understand what it means so I've left it out

Question: Would you explain what it means?

<?php
     
if (($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);
        }
?>
AttachmentSize
logintoboggan-separate-registration-link-on-collapsible-block.patch 1.21 KB

#2

Status:needs review» needs work

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

Version:5.x-1.1» 7.x-1.x-dev

#4

for 5.x, you can certainly just override the theming function in your theme, ie:

function [yourthemename]_lt_login_link() {
  ...
}

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

#10

please see http://drupal.org/project/logintoboggan#commitment for more information on how task/feature requests are handled in the module

#11

Another possible approach would be to display the login block not collapsed on the front page.

And on all other pages display the block collapsed. Anybody can suggest how to acheive that?
~~~~~~~~~~~~~~~~~

HobbyBlob.com

Showcase your Hobby to the whole world!

nobody click here