Topic-icon Facebook share page shortcode not working

Active Subscriptions:

None
Hi,

i have a page which has content hidden using jquery. When i show the content everything works ok apart from the facebook share button is not displayed(this is if i use the easytags{JFBCShare layout=button_count width=500}) if i place the easytag outside the hidden content then the share button is produced. if i call the share button directly using js script jfbc.social.feedPost(). this works in both hidden and shown content. But it doesn't load the default values of the current page(og:tags). i would have to manually insert these into code. Also the share button shows inline popup with share on time line. But feed post shows as a window with post to facebook. i have included a pic of the two different popups.

What is would like:

File Attachment:


File Attachment:


*custom image share button.
*works in hidden and shown content.
*produces a share on facebook dialogue.
*auto filled with the info of the current page (og tags).

can this be done with easytags or do i need to use a different jfbconnect function to achieve this. i tried jfbc.social.share() but nothing happened.

many thanks in advanced
The topic has been locked.
Support Specialist
11 years 2 months ago #51853 by alzander
The Open Graph tags should be on the page that is being shared already. They shouldn't be hidden in some Javascript that has to execute or else Facebook won't be able to see them.

As for the 'hidden' content, is that already on the page and the Javascript simply sets an element's display to 'visible' from 'none', or is it actually going and fetching the page from your server? If it's fetched from your server, then the code must execute the full Joomla code, including the system plugins, which are what translate our easy-tags into the actual buttons.

Any more information on the 'hiding' of content that your doing (how it works, where the content is loaded from, etc) will really help.

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

None
Hi Alex,

Sorry i don't think i made myself clear. i have a k2 page. a user logs into this page using their fb account. they then must like facebook page(i use {JFBCFan} for this}. Within this k2 page is a div with content(lets say an advert and facebook share {JFBCShare layout=button_count width=500}). this div is hidden using jquery.hide at page load. When the user has like the fan page. the content is then shown using jquery.show. At the moment when the content is shown. the share button is missing(Not produced on screen).

So the above is the first problem-

My workaround was to use <div><a href="javascript:void(0)" onclick="jfbc.social.feedPost();"><img src="images/sonet/social_wifi/facebook-share-with-friends.gif" alt="facebook share with friends" /></a></div>. this works when used in hidden content.

The problem i have with the second method is that it dosen't auto generate information from the og tags like {JFBCShare layout=button_count width=500} does. the feedpost function expects the og infor to be passed as parameters. whereas {JFBshare} pre-populates from the info contained in the page. Also if you see the dialogues in the two images a posted. Feedpost is not the equivalent to {JFBshare}.

So maybe better wording from me would be. How do i call {JFBshare} via an onclick method. This way is can have my custon share button in a hidden div that pre-populates all the info needed to share on facebook.

Hopefully i've mage it clearer.
The topic has been locked.
Support Specialist
11 years 2 months ago #51864 by alzander
This is going to take some investigation to understand why the jquery hide is preventing the share button from showing. When you first posted, I thought you meant the raw tag wasn't showing.

Can you post, or pm, the page we can test on?

Also, please note that gating content on your site behind a like button is generally against Facebook's policy terms. They also recently announced that the like gating of content from your Facebook page wouldn't work anymore.. I actually thought that ability had already been removed. Can you tell me what you're using to detect when the user has liked the page? Also, if the user has previously liked the page and visits your urn, is the content immediately unlocked, or do they have to unlike and then like it again?

Sorry for all the questions... They'll help us get you going though.

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

None
Hi,

my main concern is not why the share button is not produced by the jquery.hide function, although i did want to bring it to your attention. I would like to know how to invoke the {JFBCShare} function via javascript. This page is a portal landing page for free wifi. the user has to like the corresponding business to then get access to free wifi. I know most wifi hotspots use this and facebook is promoting its own service. But if you believe this is against their terms and conditions could you please send me a link to that information.
Also i will pm you a link to the page.

many thanks
The topic has been locked.
Support Specialist
11 years 2 months ago #51894 by alzander
Their policy update can be found below:
developers.facebook.com/blog/post/2014/08/07/Graph-API-v2.1/
Specifically, under the "Changes to Platform Policy" section:

You must not incentivize people to use social plugins or to like a Page. This includes offering rewards, or gating apps or app content based on whether or not a person has liked a Page. It remains acceptable to incentivize people to login to your app, checkin at a place or enter a promotion on your app's Page. To ensure quality connections and help businesses reach the people who matter to them, we want people to like Pages because they want to connect and hear from the business, not because of artificial incentives. We believe this update will benefit people and advertisers alike.

In general, violation of Facebook's policies can get your application or Page banned and unusable, cause the social buttons to require the "Confirm" prompt or not work altogether.

As for invoking the JFBCShare via Javascript, you basically need to show the raw HTML, like:
<div class="fb-share-button" data-href="https://developers.facebook.com/docs/plugins/" data-layout="button_count"></div>
Then, in your Javascript, try calling the following Javascript to re-parse the tags after they've been un-hidden:
FB.XFBML.parse();
Try that and let us know how it goes.

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

None
Hi Alex,

Thank you for the heads up. I see that the recommended method is to use check-ins via the post function. do you have an easytag for this. Also the FB.XFBML.parse() doesn't seem to have an effect.

Many thanks
The topic has been locked.
Support Specialist
11 years 2 months ago #51910 by alzander
I just went to your site and clicked the Like button within the Page / Like-Box. Then, I saw the following which has 2 share buttons (one is new):
File Attachment:


Are you seeing something different? That seems right to me, but if not, let me know what I'm missing.

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

None
Thank you for taking a look. Not sure why it is working for you but not me. Either way i will do some more testing and come back to you. On the issue with like gating. The method Facebook recommends is using the checkin function. The docs state this is now done via the feedpost api. do you have an easytag for checkin or javascript function for this?

Many thanks
The topic has been locked.
Support Specialist
11 years 2 months ago #51941 by alzander
I was using Chrome on a Mac when I tested, just so you know. Try different browsers to see if one works while others don't.

As for check-ins, those by name, have been deprecated:
developers.facebook.com/docs/graph-api/reference/v2.2/checkin

To do it now, you create a "Post" to the user's timeline with the Location attribute set:
developers.facebook.com/docs/graph-api/r...ence/v2.2/user/feed/
If you go to the "Publishing" section and click on the "Javascript SDK" button, there's a little bit of code that you can see there to add to the page. We don't have a built-in JS or easy-tag to do everything, including location. I'd recommend tinkering with their example.

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