3

I'm going to add the ability to comments the products trought the "Facebook comments plugin" on a dynamic web marketplace based on Yii framework .

So, today I created a new facebook app, I included the facebook sdk js file and I added this html code to the view that render a single product:

<div class="fb-comments" data-href="<?=$this->createAbsoluteUrl('site/courseDetail',array('id'=>$model->course_profile_id))?>" data-num-posts="10" data-width="470"></div>.

The comment is linked to the URL!!

Well, what happens if the domain change or if I decide to add an url rewrite engine to my web application?

I suppose that I loose all the comments....weird....it is a big limitation... I read the documentation: https://developers.facebook.com/docs/reference/plugins/comments/ and I saw that now is strongly recommended to use the html5 code because the FBML has been deprecated. Starting June 1, 2012 FBML apps will no longer work as all FBML endpoints will be removed.

So, I can't use the xid parameter such as on <fb:comments...>

right?

user1388070
  • 171
  • 1
  • 2
  • 6
  • 1
    fb:comments is an XFBML tag, not FBML, it's not deprecated For the rest of your answer, it's the same situation as keeping likes after changing URL, see http://facebook.stackoverflow.com/questions/7197919/how-can-i-move-a-url-via-301-redirect-and-retain-the-pages-facebook-likes-and-o – Igy Jun 11 '12 at 16:22
  • So, I've to implement the code that performs the mapping from the old-url to the new-url and play with redirects by reading the user agent form http header. Therefore the open graph of facebook uses the older url as reference and there is no way to update this information. – user1388070 Jun 11 '12 at 20:49
  • Basically, yes - if you need to keep the comments and likes, the old URL still needs to serve the metadata to Facebook. – Igy Jun 11 '12 at 21:10
  • At the end, I think that the best solution to avoid issues in the future is to use an .htaccess file with a special rule for the comments: RewriteRule ^comments/([^/\.]+)/?$ index.php?r=site/courseDetail&id=$1 [L]. In this way, in data-href I can put an url like this: http://domain/comments/id-product .... In this scenario, the worst case would be the change of a domain, but we can manage it with a special redirect... – user1388070 Jun 12 '12 at 09:17

0 Answers0