Topic-icon Little advice needed

Active Subscriptions:

None
2 years 5 months ago #67680 by CyrusXxX
Hello Melissa and Alex I need your advice with something. On my website as you have seen I have installed review component for handling reviews of articles but the challenge is that component uses javascript for rendering login module which I am forced to use because redirect them to login page would be bad as user would need to navigate again to article he want to review and probably give up doing so. As I do not want to use their social login function as it is buggy at best I need little help with this one.

I have managed with many errors and trials to include jfcb tag in it but it is rendered as plain text and as I have never played with javascripts I need little hint on what I am doing wrong.

Code which made tag show on pop up module is:
<code>loginHtml+= '<div class="_socialogin_method" style="font-size:1.2em">'+_this.lang.get("{JFBCLogin}")+'</div>';</code>

and it renders it in modal without any errors but it is just text (see attachment)

What would I need to change or add to make it work? Any hint would be apreciated.

In attachment I have uploaded entire script for you to see it and on line 189 you will see the code which displays jfbc tag but as I said as plain text.  

Thank you again!

   

File Attachment:

File Name: script.zip
File Size:25 KB

 
Attachments:
The topic has been locked.
Active Subscriptions:

None
2 years 5 months ago - 2 years 5 months ago #67682 by CyrusXxX
Replied by CyrusXxX on topic Little advice needed
And I figured it out how to add buttons in that modal and now my question is can I invoke social login with link for networks I have on website?

To clarify can I trigger social login of Jfbcconnect with link?

Something like: mysite.com/jfcbconnect-url-for-selected-...l-registration-login...

Thank you!
Last edit: 2 years 5 months ago by CyrusXxX.
The topic has been locked.
Support Specialist
2 years 4 months ago #67689 by alzander
Replied by alzander on topic Little advice needed
I'm very sorry for the delayed response. I was recovering from Turkey-toxicity here in the states :)

For cases where Javascript is loading our tags, as you've seen, they usually won't render properly. Our System plugin is what replaces {JFBCLogin} with the proper HTML and that isn't always triggered when loaded via Javascript.

However, it's *usually* pretty simple to add the proper HTML to the page to make the social login buttons work. If you're already able to add the modal output, this should be straightforward. Instead of {JFBCLogin}, use the following code for each social network:
<a class="sc_fblogin" href="javascript:void(0)" onclick="jfbc.login.provider('facebook');">
<img src="/media/sourcecoast/images/provider/facebook/icon_label.png" alt="Login With Facebook" title="Login With Facebook"></a>
That is the same code the login tag would enter. The main important bit is:
<a href="javascript:void(0)" onclick="jfbc.login.provider('facebook');">...</a>
You can put whatever you want in the ... (an image, simple text, etc). The <a> tag with the onclick Javascript is what will load the proper network. You can replace 'facebook' with 'google', 'twitter', 'linkedin', etc for each network.

I hope that helps, but if you need anything else with this, just let us know!

Thanks,
Alex
The topic has been locked.
Active Subscriptions:

None
2 years 4 months ago - 2 years 4 months ago #67695 by CyrusXxX
Replied by CyrusXxX on topic Little advice needed
I hope they are delicious Alex :) Don't apologize please.

I tried with example above but now that stupid pop up with form wont render it is gonna be yet another learning curve for me to do this.
the only thing which worked and generated a button is:

loginHtml+= '<a href="www.google.com/">';

Every other variation resulted in not rendering pop up.

But I am gonna figure it out as I will die before I use anything other than jfcb for social reg/login as now after adventure Mel went with correcting issues on my site everything works smooth as butter :)

Thank you again Alex :)

 
Last edit: 2 years 4 months ago by CyrusXxX.
The topic has been locked.
Active Subscriptions:

None
2 years 4 months ago #67696 by CyrusXxX
Replied by CyrusXxX on topic Little advice needed
Update: I made it but with little different aproach :)
I simply striped that script of firing on front end with theme override of component and then I used extention called EngageBox which can prevent default action of en element and replace it with another in this case loading of proper login module with jfcb buttons present.

Plus to make sure that it works for users who for some reason stop scripts from runing added simple href link leading to the log in page. Win win in every case Alex.
But the idea came from you Alex and I thank you for that :)
The topic has been locked.
Support Specialist
2 years 4 months ago #67697 by alzander
Replied by alzander on topic Little advice needed
That's great to hear! Thanks for the update on what you did to get things rolling and I hope it's smooth sailing from here.

If you need anything else, as always, just let us know!

Alex
The topic has been locked.