我需要分享我的产品细节(名称,图像和描述)从我的网站到脸书和LinkedIn,但没有显示在FB中的任何东西,但网址是通过所有参数。我的代码如下
@foreach ($data['products'] as $list)
<img src="{{ $list['oneimage'] }}" alt="">
@endforeach
@foreach ($data['products'] as $list)
{{ $list['name'] }}
{{ $list['description'] }}
<a href="http://www.facebook.com/sharer.php?u={{url('/Shop/'.$data['webname'].'/products/'.$list['id'].'/details')}}&summary={{$data['webname']}}&og:image={{$list['oneimage']}}" target="_blank">
</a>
<a href="https://www.linkedin.com/shareArticle?mini=true&url={{url('/Shop/'.$data['webname'].'/products/'.$list['id'].'/details')}}&title={{$data['webname']}}&summary={{$data['webname']}}" target="_blank"></a>发布于 2020-10-09 00:41:36
您的URL格式正确...
https://www.linkedin.com/sharing/share-offsite/?url={url}来源:。
因此,您现在需要设置的就是og:标记,以指示标题、摘要、图像等内容。这些标记将被插入到您的HTML...的<head>块中
<meta property='og:title' content='Title of the article'/><meta property='og:image' content='//media.example.com/1234567.jpg'/><meta property='og:description' content='Description that will show in the preview'/><meta property='og:url' content='//www.example.com/URL of the article' />来源:
如果您想检查是否一切都做对了,那么可以查看。从普通的老式<title>标签到oEmbed和og:标签的所有内容都将被检查和测试,并将结果显示给用户。下面是我使用上述代码组装的一个小演示站点:EarthFluent.com。
https://stackoverflow.com/questions/63491898
复制相似问题