Multiple Facebook Like buttons (different activities) on one page? - facebook

My one web page uses Ajax to display information about multiple activities.
I'd like to have one Like button per activity. This would mean multiple Like buttons on the page, one per activity. Can this be done?
Can the Like button's url include #!state1 ?
Eg, a web page is located at www.example.com/index.html
It has multiple FB Like buttons on it, one for url www.example.com/index.html#!activity1
another for www.example.com/index.html#!activity2
Will the two Like buttons work independently?

You can have multiple like buttons on a single page, but each like button must be linked to a separate page.
Eg: if you have products, each listing could have a like button next to it, but that like button would link to the product details page.
If you really wanted to, create phantom pages on your site with some meta tags. Then on your index.html, use like buttons that link to those pages.
To ensure no one ever gets to your phantom page, include the tag:
<meta http-equiv="refresh" content="0;url=http://www.example.com/index.html/">
That way, if someone clicks on the link that comes up on a facebook wall, they'll be redirected to the correct page.

Related

How do I add a like button to my facebook page and change the name to a company name?

I noticed some facebook company pages like:
http://www.facebook.com/companyname
Can change the persons name to the company name and also add a like button. How does one achieve these two things?
Add a like button to a company page of a URL like this - http://www.facebook.com/companypage
Add a like button on that page?
You need a special account designed for business, you cant just do it to a personal account.
https://www.facebook.com/business/overview
Once you reach enough likes on Facebook you can get your own "short page-link". You only need a few likes (100-200 I think it is).
A like button is already on your page. However you can add an extra tab using HTML and Iframes to a remote document with a like button. The like button is found on Facebook's dev pages.
https://developers.facebook.com/docs/plugins/like-button/
Code in HTML for Like Button
Detailed steps mentioned on the page on how to embed
You can add various styles too and a code will be generated for you

Want to share a particular block or div from my entire page into facebook

I have a requirement that in a webpage I have multiple block of content which is wrapped inside individual DIV. Each block needs to have a share to facebook button.
Did many researches but couldn't find a solution. Please can anyone give me a suitable code or idea how I can share particular blocks/content wrapped inside a div into facebook.
For e.g.
I have three DIV in my page and each DIV has share button, when user clicks on any of the share button the respective DIV is shared.
Is there any solution to this requirement or whether is it possible to do. Any kind of suggestions are widely accepted.
Check out this HyperArts tutorial on adding a Share Button to an iFrame tab - you use the exact same code for your webpage. You will be using the Facebook JavaScript SDK.
At the end of the tutorial it explains how to modify it to allow for multiple Share buttons on one page. You just need to add a unique identifier for each one.

handle subpages inside facebook app (with one single tab)

My goal is that have a fb page app (only in one tab) and use it with linkable subpages inside it.
For example:
If I click on subpage link there would be a http or ajax request inside the iframe. Thats fine, i can do that.
BUT
in the solution I also want to implement these two features:
1.:
I want that page to be accessible directly from an url like:
http://facebook.com/pagename/app..blabla/subpage1
or
http://facebook.com/pagename/app..blabla&sk=535&subpage=1
or
http://facebook.com/pagename/app..blabla#subpage1
2.:
On subpage link click inside iframe I want the browser url to turn into something like mentioned in the 1. point. (even when using ajax - probably with a hash tag)
Is it possible?
If you look at the page tab tutorial http://developers.facebook.com/docs/appsonfacebook/pagetabs/ at the bottom of the page they describe how you can create the 'subpage' idea using the app_data parameter. So your links will look like http://www.facebook.com/YourPage?v=app_1234567890&app_data=any_string_here
For your second question, in the links on the page you would specify target="_top" in any links you have with the href being: http://www.facebook.com/YourPage?v=app_1234567890&app_data=subpage1. This will cause the entire page tab to load through Facebook and you'll get the signed_request and your app_data parameters.
You probably don't want your ajax to load through facebook, because you'll get the Facebook page back instead of json or whatever you are trying to load. Instead you'll just make ajax calls to your server and pass the parameters you need to, like app_data or whatever you want.

Facebook like button on a product page

My requirement is to integrate my client webpage and facebook using the Flike button.
I have an html page which is used for all the products. Based on the product code selected, the content in the page changes. The URL format is something like this -
in the browser it shows : http://xyz.com/product.aspx,
in the view source, in the action attribute of the form tag : ../../product.aspx?prdcode=123&catcode=3453
Now, my requirement is to place an flike button on this page. I have tried doing it in several ways... but the issue is:
If I click on flike button on one page.. the button is disabled for every other product.
Not sure what all needs to be included in to get this functionality right.
For a product listing page you'd need to have multiple like buttons, each pointing at a URL which represents an individual product - each of those pages needs the appropriate open graph meta tags, include the JS SDK once on your listing page, and have multiple <fb:like tags pointing at the individual product URLs
If the page content is dynamic, I think you can do the same, but you'll need to remove and add the like button as the content changes

How can we "like" mulitple urls using fb like box

How can I like multiple urls with a single click on fb-like button ?
You can't. Spammers would abuse that like crazy. You can have multiple like buttons on a page though, just set different href values for each thing you want people to like.