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

druvision’s picture

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
StatusFileSize
new1.21 KB

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?

      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);
        }
hunmonk’s picture

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.

druvision’s picture

Version: 5.x-1.1 » 7.x-1.x-dev
druvision’s picture

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

hunmonk’s picture

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.

zilla’s picture

hello hunmonk and others - was this rolled into the d6 version yet?

hunmonk’s picture

@zilla: any updates to this issue will be posted to this issue. you only need to monitor the issue.

bryan kennedy’s picture

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.

hunmonk’s picture

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

hunmonk’s picture

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

alexbk66-’s picture

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!

stevecowie’s picture

On #11 you could create a modified .js script that checks for window.location and you'll be able to work out if this is the home page. You could then do $(this).show() instead of the default $(this).hide(). You would have to do a form_alter to override LT's version with your modified js.