2

I am using the very helpful hybridAuth module to allow people to login with their social media accounts.

However, the login form shows up as shown below:

enter image description here

Looks a bit confusing, doesn't it?

I want to move the social media login button either to the top or bottom and create distinction with the actual login form

The form structure displayed at the top of the page is from hook_form_alter but I saw no obvious way to manipulate the form to achieve the desired effect.

I implemented the following code in an attempt to get my hook_form_alter to execute after hybridAuths' and perhaps find a way to reorder the form:

function mymodule_module_implements_alter(&$implementations, $hook){
    if($hook == 'form_alter '){
        dsm($hook, 'Hook');
        dsm($implementations, 'Implementations - form-alter');

        $group = $implementations['mymodule'];
        unset($implementations['mymodule']);
        $implementations['mymodule'] = $group;

        dsm($implementations, 'Implementations #2 - form-alter');
    }
}

However, my debug dsm code does not show up on my user/login page even though there is a form and hook_form_alter does respond to it on the same page.

Can anyone suggest something that might help, please?

1
  • 1
    Make sure that the module implementing hook_form_alter is enabled, do drush cc all and if still does not work try var_dump() or another debugging function. Altering the registry for such a reason is an overkill. Then try to use the #weight attribute to reorder the form's elements.
    – mchar
    Commented Feb 7, 2017 at 10:20

2 Answers 2

2

You can alter the form and check ['#weight'] for reordering form element.

2

HybridAuth module can make the block for this icons then you can place that icons block top of the main content block. it will show top of the login form

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.