XF 2.1 Library not loaded in login popup

ForumX

New member
Hello Guys,
I'm using a login button which render through javascript library. It's working fine when i open link "index.php/login" but when i open by home screen login button it not shown in popup screen. I checked the console there is no error there. Further i checked the library not load in the popup screen, Any suggestion to solve this ?

Thanks
 
Last edited:
Thanks for reply,
I using the following code
<fast-button></fast-button>
<xf:js type="text/javascript"src="https://js.fast.co/button.js?key={$xf.fast_api_key}&icon=left"></xf:js>
This button is custom login button for third party library.
It's working fine without using in login popup. In popup the library not load in that case it not display on custom login button popbox. But if i open in seprate tab it works fine.
 
Try this

Code:
<fast-button></fast-button>
<xf:js src="https://js.fast.co/button.js?key={$xf.fast_api_key}&icon=left" />
<xf:if is="$xf.app.request.get('_xfResponseType') == 'json'">
<xf:js>fastButton.init();</xf:js>
</xf:if>
 
Last edited:
By using the above code, it showing the login button multiple time on the home page footer.I think it called the following code
<fast-button></fast-button>
multiple time which in result the show the multiple login button.
If there any way to called for only popup box.?
 
I using template modification for using login button on the footer of home page. So by clicking on login button your code is trigger which which in effect also add the same button in the footer of home page.
 
I am sorry, but I don't understand what you are talking about.

You said you've got
Code:
<fast-button></fast-button>
<xf:js type="text/javascript"src="https://js.fast.co/button.js?key={$xf.fast_api_key}&icon=left"></xf:js>
in template login and that this does not work if the template is loaded as an overlay.

But now you are talking about buttons in footer?

Please explain exactly what you are trying to do/what you have implemented, otherwise it is difficult to help you.
 
That's not really possible as the JS is not designed to be run multiple times.

You could try a nasty hack though:
Code:
<fast-button></fast-button>
<xf:js src="https://js.fast.co/button.js?key={$xf.fast_api_key}&icon=left" />
<xf:if is="$xf.app.request.get('_xfResponseType') == 'json'">
<xf:js>
$('fast-button')[0].innerHTML = '';
fastButton.init();
</xf:js>
</xf:if>

Btw: Why on earth do you want to have a login button in footer? Seems completely pointless to me :)
 
Back
Top Bottom