ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Facebook Comments Adding URL Query

March 22, 2012 1:12pm

Subscribe [2]
  • #1 / Mar 22, 2012 1:12pm

    Greg Griffith

    37 posts

    Trying to integrate Facebook Comments, and noticing two things:

    1. In Facebook, the notification that someone has commented on a page includes a URL in which Facebook’s comment-id info is appended to the normal EE url structure, like this:

    .../28532?fb_comment_id=fbc_10150636050429821

    Clicking the link takes the user to the site’s home page, not to entry 28532.

    2. When someone comments using Facebook, the preview that’s posted to their wall comes from the site’s home page, not from the entry page where it should be coming from.

    I assume this because EE is having trouble parsing the URL query, and defaulting to the home page. I’ve tried adding a trailing slash, but that just makes things worse.

    Anybody know how to fix this?

  • #2 / Mar 23, 2012 2:35pm

    Shane Eckert

    7174 posts

    Hey Greg,

    Thank you for posting your question.

    How are you integrating Facebook Comments?

    Is this an Add-On like EE2 FB Comments?

    Please let me know and we can go from there.

    Cheers,

  • #3 / Mar 24, 2012 4:30pm

    Greg Griffith

    37 posts

    Hi Shane,

    I’m not using an add-on, just using the Facebook Comment widget and my app id.

    So I have an fb-root div and the FB connect JS, like this:

    <div id="fb-root"></div>
    [removed](function(d, s, id) {
      var js, fjs = d.getElementsByTagName(s)[0];
      if (d.getElementById(id)) return;
      js = d.createElement(s); js.id = id;
      js.src = "//connect.facebook.net/en_US/all.js#xfbml=1&appId=222975477764498";
      fjs[removed].insertBefore(js, fjs);
    }(document, 'script', 'facebook-jssdk'));[removed]

    ... followed by the FB comment tag like this:

    <div class="fb-comments" data-href="http://www.standfirminfaith.com/index.php/sf/{exp:weblog:entries rdf="off"}{entry_id}{/exp:weblog:entries}" data-num-posts="20" data-width="570"></div>

    The comments load just fine, they stay attached to the thread they’re supposed to be attached to; the problem is that when you click on a notification in your Facebook inbox, you land at the home page because EE’s index.php is evidently not doing any parsing of URL element 3, the entry_id. It behaves like it’s trying to find the entry called “28532?fb_comment_id=fbc_10150636050429821” instead of just 28532.

  • #4 / Mar 27, 2012 5:23pm

    Shane Eckert

    7174 posts

    Hi Greg,

    I think you might want to ask this question of FB support.

    This is really not related to ExpressionEngine as this is a third party app.

    Is there anything else I can help with?

    Cheers,

  • #5 / Mar 29, 2012 7:37pm

    Greg Griffith

    37 posts

    No, just hoping someone had run into this before. Thanks for your time, Shane!

  • #6 / Apr 03, 2012 5:33pm

    Shane Eckert

    7174 posts

    Hi Greg,

    No worries. I wish I could have been of more help.

    Have a great week!

    Cheers,

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases