dphphvs496524 2013-05-19 15:39
浏览 14

动态生成的开放图形标记缺少URL中的参数

I'm generating open graph meta tags dynamically from url paramaters. When I display the page, everything looks fine and if I check the page source, all my meta tags are generated perfectly. Here is the code that I use to generate them:

<?
$theSet = htmlspecialchars($_GET['id']);
$theTitle = htmlspecialchars($_GET['title']);
$theTitle1 = str_replace(" ","+",$theTitle);
$theTitle2 = str_replace(" ","-",$theTitle);
?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="fr-FR">
<head>
    <meta charset="utf-8" />
    <link rel="canonical" href="http://www.novo-monde.com/photo-album.php?id=<? echo $theSet; ?>&amp;titel=<? echo $theTitle1; ?>" />
    <title><? echo "Album photo ".$theTitle.""; ?></title>
    <meta name="description" content="Vous trouverez sur cette page toutes les photos à propos de l'<? echo "album photo ".$theTitle.""; ?>.">
    <meta property='og:locale' content='fr_fr'/>
    <meta property="og:title" content="<? echo "album photo ".$theTitle.""; ?>" />
    <meta property="og:type" content="article" />
    <meta property="og:description" content="Vous trouverez sur cette page toutes les photos à propos de l'<? echo "album photo ".$theTitle.""; ?>." />
    <meta property="og:url" content="http://www.novo-monde.com/photo-album.php?id=<? echo $theSet; ?>&amp;titel=<? echo $theTitle1; ?>" />
    <meta property="og:image" content="<?getSetSing($theSet);?>"/>
</head>

However, i have problems when I want to share one of these urls on facebook. In fact, when I share it, facebook seems to remove the "titel" parameter defined in the url. Lets take an example. If I have the following url:

http://www.novo-monde.com/photo-album.php?id=72157633440493567&title=Walensee

the page looks fine and the meta tags in the page source are defined properly. However if I enter this url in the facebook debug tool (as it does not work properly on facebook), the tool ignores the "titel" parameter and uses this one instead:

http://www.novo-monde.com/photo-album.php?id=72157633440493567&titel=

Does anyone know why what is defined after the "titel=" is beeing ignored ??? I have no idea where to look anymore...

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 c语言怎么用printf(“\b \b”)与getch()实现黑框里写入与删除?
    • ¥20 怎么用dlib库的算法识别小麦病虫害
    • ¥15 华为ensp模拟器中S5700交换机在配置过程中老是反复重启
    • ¥15 java写代码遇到问题,求帮助
    • ¥15 uniapp uview http 如何实现统一的请求异常信息提示?
    • ¥15 有了解d3和topogram.js库的吗?有偿请教
    • ¥100 任意维数的K均值聚类
    • ¥15 stamps做sbas-insar,时序沉降图怎么画
    • ¥15 买了个传感器,根据商家发的代码和步骤使用但是代码报错了不会改,有没有人可以看看
    • ¥15 关于#Java#的问题,如何解决?