Jump to:

794 Posts in 409 Topics by 304 members

Widgets

SilverStripe Forums » Widgets » LinkedIn share tags

Discuss SilverStripe Widgets.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 1172 Views
  • Brand
    Avatar
    Community Member
    8 Posts

    LinkedIn share tags Link to this post

    Dear fellow SS users. I have tuned the metatags over and over again and nothing seams to work. I can't get the LinkedIn share widget filled with information about the right page. The only thing LinkedIn gets, is the name of the domain. Does anybody knows what goos wrong? Here is the code:

    $MetaTags
    <meta property="og:title" content="$Title" />
    <meta property="og:url" content="http://www.realimpact.nl" />
    <meta property="og:image" content="http://www.realimpact.nl/assets/logolinked.png" />
    <meta property="og:description" content="<% if MetaDescription %>$MetaDescription<% else %>$Title<% control GetHomePage %>$MetaDescription<% end_control %><% end_if %>"/>

    If you want to try it real time: www.realimpact.nl

    BTW, the facebook domain gets the og's right...

  • epidote
    Avatar
    Community Member
    2 Posts

    Re: LinkedIn share tags Link to this post

    I have the same problem, adding
    <?xml version="1.0" encoding="UTF-8"?>
    to Page.ss fixes the linkedin issue BUT breaks the site (FF, Safari at least) due to xml validation

    site already has
    <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
    as described in a few posts to fix the issue, but most posts say delete
    <?xml version="1.0" encoding="UTF-8"?>
    to fix but that seems to be the only thing that fixes linkedin??

    That help you? Any ideas?

  • epidote
    Avatar
    Community Member
    2 Posts

    Re: LinkedIn share tags Link to this post

    In case anyone else has the same problem I tracked this down to the Header -

    This was the old header that killed linkedin
    Content-Type: text/html; charset="utf-8"

    This works fine for linkedin
    Content-Type: text/html;

    I just edited mysite/code/Page.php

    class Page_Controller extends ContentController {
          
       public function init() {
          parent::init();   
        $this->response->addHeader("Content-Type", "text/html");
             
       }
       
    }

    utf8 still set in template and all appears to be working/dispalying fine.

    1172 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.