The only thing being sent is the URL to the current page, not the content of that page. If it’s being “sent”, it’s just a fact of how Facebook is interpreting the page. What they are doing is “scraping” the page for HTML, and they must be grabbing the first DIV containing some meaningful text and calling it done. So no matter which button you pressed, you’re only going to get the first N characters of readable text from the page. What you’re going to need to do in order to give each favorite some unique content is to create a template page (using WebYep) that contains only the unique content for each story, and link to that. So if you made your WY page for the second story on the page have a URL in your site like detail.php?id=12345 (no idea what your URLs really look like, that’s just a guess), you would need to put that unique URL into the code I wrote, something like this:
window.location.href='http://www.facebook.com/sharer.php?u='+'<?php echo rawurlencode('http://yoursite.com/' . $yourPageUrlHere); ?>';
What that’s doing is putting the encoding and the URL in PHP in the midst of a line of JavaScript. You’ll have to figure out what WebYep calls the variable with the dynamic URL inside of a loop, and substitute that for my made-up variable, but once you know that, the button will work exactly the same way.
I would make these dynamic detail pages links from the headline in your loop content, too, so it’s not a big mystery to Google or human visitors what these detail pages are all about. Naturally, you would have links back to the main category page, and your global navigation, so that the visitors who come from Facebook will have context to understand where this story fits into your overall content picture.
Walter
On Dec 30, 2011, at 12:24 PM, rakeljuice wrote:
ok. First Problem FIXED !!
As I saw it was a problem in my code, satarted again and it works now. THANKS!!
Now, my second problem is that when you click the button, the content should be sent is the one of this piece of news, but it is always sent the first news content.
For example, in the page we are working whith, if you click the Matrix news, the content sent is the Ecoaldea one.
Ive put the button insideo the webyep loop
freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options
freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options