We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 8442
    • 48 Posts
    Hi there, does anyone know ho to implement facebook comments with a dynamic page URL? Currently I have a chunk set up with

    <div id="fb-root">
    </div>
    <script src="http://connect.facebook.net/en_US/all.js#appId=APP_ID&xfbml=1"></script><fb:comments href="******" num_posts="10" width="700"></fb:comments>
    


    Currently it only points to the URL I have given not the individual pages it appears on.Do I need to do it with a snippet and include a php tag to get the URL? Not really sure...

    Thanks in advance
      • 8442
      • 48 Posts
      Figure it out if anyone else needs this:

      Create snippet with the following code pasted in:

      <?php echo "http://" . $_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI'];


      Then reference the snippet in the facebook comment url:

      <script src="http://connect.facebook.net/en_US/all.js#appId=APP_ID&amp;xfbml=1"></script><fb:comments href="[[geturl]]" num_posts="10" width="700"></fb:comments>
        • 24393
        • 83 Posts
        I don’t think you need a snippet for this...

        
        <fb:comments href="[(site_url)][~[*id*]~]" num_posts="10" width="700"></fb:comments>
        
        
          stevesunderland.com
          GRAPHICS | INTERACTIVE | MARKETING
          xhtml + ajax + seo websites powered by modx