Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: New facebook "like" button and open realty

  1. #1
    Join Date
    Feb 2007
    Posts
    82

    Default New facebook "like" button and open realty - SOLVED

    Hi
    I'm trying to get the new facebook like button to work with an open realty site but have a problem with individual listing urls.
    The code required is:
    I've added this to the html tag-
    Code:
    xmlns:og="http://opengraphprotocol.org/schema/"
          xmlns:fb="http://www.facebook.com/2008/fbml"
    and this in the head of main.html
    Code:
    <meta property="fb:admins" content="My Facebook User ID"/>    
     <meta property="og:title" content=""/>
        <meta property="og:type" content="company"/>
        <meta property="og:url" content="http://www.MYDOMAIN.com"/>
        <meta property="og:image" content="http://www.MYDOMAIN.com"/>
    Then in listing_detail_tabbed.html
    Code:
    <div id="fb-root"></div>
    <script>
    window.fbAsyncInit = function() {
    FB.init({appId: 'MY APP ID', status: true, cookie: true,
    xfbml: true});
    };
    (function() {
    var e = document.createElement('script'); e.async = true;
    e.src = document.location.protocol +
    '//connect.facebook.net/en_US/all.js';
    document.getElementById('fb-root').appendChild(e);
    }());
    </script>
    
                <fb:like href="http://www.MYDOMAIN.com/{link_to_listing}" layout="standard" show_faces="true" width="450" action="like" font="tahoma" colorscheme="light"></fb:like>
    What happens is with http://www.MYDOMAIN.com/{link_to_listing} in between the <fb:like></fb:like> tags the correct listing url is displayed, but the same link doesn't work in the meta property tag in the head section, so what happens is facebook "likes" the main domain name rather than individual listings.
    How can I get the correct listing url into the meta property tag in the head section of main.html to include url, image and content like below?
    Code:
    <meta property="fb:admins" content="My Facebook User ID"/>    
     <meta property="og:title" content="I REQUIRE LISTING TITLE HERE"/>
        <meta property="og:type" content="company"/>
        <meta property="og:url" content="http://www.MYDOMAIN.com/I REQUIRE LISTING URL HERE"/>
        <meta property="og:image" content="http://www.MYDOMAIN.com/I REQUIRE LISTING THUMBNAIL HERE"/>
    Thanks
    Tony

    MOVED to Template Help and discussion.

  2. #2
    Join Date
    Feb 2007
    Posts
    82

    Default Re: New facebook "like" button and open realty

    Hi
    I'm still trying to insert the property title and url in the meta property as above. If anyone can find a solution I would appreciate it and would be happy to help anyone else set this up as the viral aspect of this is fantastic.
    Thanks
    Tony

  3. #3
    Join Date
    Dec 2007
    Posts
    83

    Default Re: New facebook "like" button and open realty

    Have you actually tried clicking on the link in the tabbed listing to see if it works? I thought OR normally didn't render JS unless it was added to either first or last JS tag.

    Have you checked the docs for template tags that work on main.html? I did a quick look and didn't see that {linktolisting} included there but I might have missed it

  4. #4
    Join Date
    Feb 2007
    Posts
    82

    Default Re: New facebook "like" button and open realty

    Quote Originally Posted by OBX View Post
    Have you actually tried clicking on the link in the tabbed listing to see if it works? I thought OR normally didn't render JS unless it was added to either first or last JS tag.

    Have you checked the docs for template tags that work on main.html? I did a quick look and didn't see that {linktolisting} included there but I might have missed it
    Hi OBX
    Yes the link does work, not sure now how I came across it ({linktolisting}) but will update the post if I find it. If you view source on this listing http://www.onestopview.com/listing-S...kage-2099.html you will see the correct url is input between the <fb:like> tags, but I need a similar tag/solution for the facebook meta property tags for title and url

    Thanks

  5. #5
    Join Date
    Dec 2007
    Posts
    83

    Default Re: New facebook "like" button and open realty

    I only worked with it a second but this seemed to work on my local testbed

    Code:
    <meta property="og:title" content="{listing_title}"/>
    <meta property="og:type" content="company"/>
    <meta property="og:url" content="{fulllink_to_listing}"/>
    <meta property="og:image" content="http://www.onestopview.com"/>
    I'm not sure what image you wanted for it. And I still think you'll need to make an addon to add the javascript to the $js variable in OR so it is properly added.

  6. #6
    Join Date
    Feb 2007
    Posts
    82

    Default Re: New facebook "like" button and open realty

    Quote Originally Posted by OBX View Post
    I only worked with it a second but this seemed to work on my local testbed

    Code:
    <meta property="og:title" content="{listing_title}"/>
    <meta property="og:type" content="company"/>
    <meta property="og:url" content="{fulllink_to_listing}"/>
    <meta property="og:image" content="http://www.onestopview.com"/>
    I'm not sure what image you wanted for it. And I still think you'll need to make an addon to add the javascript to the $js variable in OR so it is properly added.
    Hi OBX
    That doesn't work, the url is not passed to the page. I've made "some" progress although not an seo friendly link i've discovered that <meta property="og:url" content="http://www.onestopview.com/index.php?action=listingview&listingID={listingid} "/> returns the correct listing url and facebook "likes" the individual listing. Now all I need is a way to input the listing title and a listing thumbnail into the <head></head> section to display that information on the persons "friend" list

    EDIT:
    for an example of what I am trying to achieve see this page about how it integrates with the IMDB website http://developers.facebook.com/docs/opengraph
    Last edited by asnorth; 05-07-2010 at 06:25 PM. Reason: added example link

  7. #7
    Join Date
    Dec 2007
    Posts
    83

    Default Re: New facebook "like" button and open realty

    what version of OR are you running?

  8. #8
    Join Date
    Feb 2007
    Posts
    82

    Default Re: New facebook "like" button and open realty

    Version 2.4.4 . I can't upgrade as I bought an addon that is important to the function of the site and it required core file changes. I know I can have that change written into a new addon but so far I've not been able to justify the cost as 2.4 has worked without any problems.

    EDIT: When I said {fulllink_to_listing} didn't work I should have been more specific, it does work in the template files/body of the website, but it doesn't work within the <head></head> tags
    Update: I've deleted the facebook meta tag for title and it now automatically adds the title as the anchor text. Perfect!
    Now all I'm stuck on is getting a thumbnail image to display. All I need for this is to insert the absolute path to the listings thumbnail in the head tag. {image_thumb_1} does not work in between the head tags.
    Thanks

  9. #9
    Join Date
    Feb 2007
    Posts
    82

    Default Re: New facebook "like" button and open realty

    OK, got it all working although I'm not entirely sure how useful the image will be anyway. This is how I setup the facebook meta tags in the head section of main.html
    <meta property="fb:admins" content="MY FACEBOOK USER ID"/>
    <meta property="og:site_name" content="MYDOMAIN.COM"/>
    <meta property="og:type" content="company"/>
    <meta property="og:url" content="http://www.MYDOMAIN.COM/index.php?action=listingview&listingID={listingid} "/>
    <meta property="og:image" content="http://www.MYDOMAIN.COM/images/listing_photos/thumb_{listingid}_1.jpg"/>

  10. #10
    Join Date
    Oct 2006
    Posts
    112

    Default Re: New facebook "like" button and open realty

    Tony

    Many thanks for this. I had a request from a client for this and it all works as you describe. So bravo! (As there's no like button to click).

    Terry

Similar Threads

  1. FYI: remove "Save This Search" button for users not signed in.
    By sushigraphix in forum Sandbox (CLOSED)
    Replies: 5
    Last Post: 07-31-2009, 12:22 PM
  2. Replies: 1
    Last Post: 07-15-2009, 02:15 PM
  3. Replies: 0
    Last Post: 07-10-2009, 08:45 PM
  4. Jcran Internet Solutions latest "Open Realty" completions
    By jcran in forum Show Off (CLOSED)
    Replies: 7
    Last Post: 10-03-2004, 10:55 AM
  5. bug in "Browse All Listings " Open-realty demo
    By Vindex in forum Bugs (CLOSED)
    Replies: 0
    Last Post: 09-22-2003, 04:20 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •