PDA

View Full Version : Custom Pages not showing "Facebook Connect" button


bzcomputers
04-16-2013, 02:17 PM
I have some custom pages on which everything seems to work fine but the "Facebook" button will not show in the header.

When checking the page source code I see that the first line in the facebook_header template that is called is causing the element to be "hidden".


<li id="fb_headerbox" class="hidden">


Why is this line affecting my custom pages but not any of the standard vB pages when it is called.

kh99
04-16-2013, 02:31 PM
I think there's a javascript file that needs to be included, which checks the user's status and makes the button visible if they're not already "connected". I don't know offhand exactly what it's called or how it gets included on the standard pages.

bzcomputers
04-16-2013, 10:06 PM
Been searching for missing java or possibly css, but haven't come up with anything yet.

kh99
04-16-2013, 10:10 PM
Hmm...are there any javascript errors on the page?

Can you give us a link to a page with the problem?

bzcomputers
04-16-2013, 10:31 PM
no java errors.
here is a page that will not show the "Facebook" button:

http://www.cruisin.me/info/carnival/

It consistently will not show the "Facebook" button on all custom pages, but appears correctly on all vB standard pages.

-----------
Edit: These custom pages all reside outside of the forum directory, so if something in java/css is using a relative reference it probably isn't getting loaded. But I didn't find anything myself.

kh99
04-16-2013, 10:42 PM
I think the facebook button that you've added at the top is interfering with the built-in one. I see these 2 warnings in the js console:

The "fb-root" div has not been created, auto-creating
FB.getLoginStatus() called before calling FB.init().



I think it might be because the new buttons call the facebook script before the html for the built-in vb button is reached. I'm not sure what to do about that - maybe try moving the js for the add buttons to be later in the code? I guess if it's a mod that will be difficult.

bzcomputers
04-16-2013, 10:59 PM
Ahh, you found the conflict. Thanks.

It wasn't quite what you thought but I know where the conflict is now. The links at the top of the page are just hyperlinks to social pages with no java, so the issue wasn't there.


Lightbulb goes off... the "Facebook" connect button is not showing on ANY page that has "AddThis" social sharing code. Which for me is all custom pages, CMS articles, threads, etc - a ton of pages


Seems that anyone using AddThis on vBulletin should be seeing this issue.

-------------------------
Edit: Found some info on AddThis for asynchronous loading. Seems to have solved the conflict. Thanks again.

http://support.addthis.com/customer/portal/articles/381221-optimizing-addthis-performance