Topic-icon Social Login buttons workflow - request

Support Specialist
3 years 5 months ago #66848 by alzander
We don't have a method to hide the registration section if only a specific button is pressed. You'd have to hide that on your own through a template override. To do that, you can copy the /components/com_jfbconnect/views/loginregister/tmpl/default.php to /templates/<YOUR_TEMPLATE>/html/com_jfbconnect/loginregister/default.php

Then, edit the new file. You can hide the whole registration section by wrapping it in tags like:
<?php if ($this->providerName !== 'instagram') : ?>
.... all of the registration block
<?php endif; ?>

I hope that helps,
Alex
The topic has been locked.
Active Subscriptions:

None
3 years 5 months ago #66853 by joomleb
Hi Alex,
many thanks for the suggestion.
Why not to add something simple to the standard code that can be useful for all the users here ?!? I mean (I'm not a developer, just to explain what I mean):

<?php if ($this->providerName !== 'instagram') : ?>
.... to add a .instagram class to the entire div#jfbc_loginregister page
<?php endif; ?>

In this way and by default, we can use:
div#jfbc_loginregister.twitter
div#jfbc_loginregister.facebook
div#jfbc_loginregister.google
...etc

to customise the page as we want depending on the social (colors, background etc.), in my case also by hiding the div #jfbc_loginregister_newuser part when instagram has been clicked.

What do you think about ?
Please, Can you help on it ?
The topic has been locked.
Active Subscriptions:

None
3 years 5 months ago #66861 by joomleb
Hi guys, Please, Can you help on this ?
The topic has been locked.
Active Subscriptions:

None
3 years 5 months ago #66873 by joomleb
Hi Alex,
Please, Can you help with code about my previous post issue ?
I tested this code: stackoverflow.com/questions/18265058/ins...ass-if-true/18265069 to add the .instagram class, but for sure I'm missing a small thing, or I'm positioning it wrongly and it is not running...

<div class="<?php if ($this->providerName !== 'instagram') { echo 'instagramclass'; } ?>"></div>
The topic has been locked.
Support Specialist
3 years 5 months ago #66877 by alzander
You're correct, adding the provider name to the registration/login fields would be helpful for various reasons.

The way I'd recommend is by adding to the following div at line 23 in the /loginregister/tmpl/default.php file:
<div id="jfbc_loginregister" class="row-fluid">
Update that to:
<div id="jfbc_loginregister <?php echo $this->providerName; ?>" class="row-fluid">
With that, you could use the following CSS to target the registration area for Instagram only and hide it:
#jfbc_loginregister.instagram #jfbc_loginregister_newuser {
  display:none;
}

I've added this to our issue tracker and don't see any reason it wouldn't be in the next release.

Thanks!
The topic has been locked.
Active Subscriptions:

None
3 years 5 months ago #66878 by joomleb
Hi Alex,
simple and efficient, happy to read that you like it, many thanks!

Suggestion: wouldn't it be better to add it in this way?
<div id="jfbc_loginregister" class="row-fluid <?php echo $this->providerName; ?>">
OR, if you doubt / are worried for conflicts
<div id="jfbc_loginregister" class="row-fluid jfbc_<?php echo $this->providerName; ?>">
In this way id #jfbc_loginregister remains unchanged and valid for all socials for common rules.
While when we need a specific rule we can add the social class. Less code (custom CSS)
What do you think about it?
The topic has been locked.
Support Specialist
3 years 5 months ago #66879 by alzander

Suggestion: wouldn't it be better to add it in this way?

Not just better, it would be the correct way to do it!

I screwed up in my code. You can't set an id to multiple items, so id="blah blah1" is invalid.

Your way is the correct way. Thanks for pointing that out!

Alex
The topic has been locked.
Active Subscriptions:

None
3 years 5 months ago #66880 by joomleb
Hi Alex,
perfect ! So, I'm going to use the "personalised one":
<div id="jfbc_loginregister" class="row-fluid jfbc_<?php echo $this->providerName; ?>">

Please, Will this addition be included in the next JFBConnect release?
(Sorry, I have to order all my information or I'm lost :=D )
The topic has been locked.
Support Specialist
3 years 5 months ago #66881 by mel
Yep. I've already checked in the change for the next release to add the class to the div.

I was not planning on adding the css style to hide the targeted element, as that is not the default behavior we'd like for JFBConnect.

-Melissa
The topic has been locked.
Active Subscriptions:

None
3 years 5 months ago #66882 by joomleb
Hi Mel,
as I wrote, in my case the need to use a CSS style to hide the registration part is due to the configuration (Instagram no longer copying the email and it would generate problems).
However, I see the CSS style very useful for customisation according to the Social, for example having the titles "Login" and "Registration" in the same color as the Social called...

All together we found a useful and practical solution, Many Thanks!
The topic has been locked.