facebook-opengraph - 从标题中修改 Blogger 模板 : Is there some way to access data:post. 标签?

标签 facebook-opengraph blogger

我希望能够从 Blogger 的标题中访问 data:post.labels。我只打算在 data:blog.pageType == "item" 时使用它,这样一个页面上的多个帖子就不会出现任何困惑。然而,我所做的一切尝试都没有产生任何结果。如果我发现一种访问数据的方法,我计划对这些数据执行以下操作:

<b:if cond='data:blog.pageType == &quot;item&quot;'>
    <b:loop values='data:post.labels' var='label'>
        <b:if cond='label.name == &quot;poetry&quot;'>
            <meta expr:content='&quot;Poem “&quot; + data:blog.pageName + &quot;”&quot; + &quot; at Form and Formlessness&quot;' property='og:title'/>
        </b:if>
        <b:if cond='label.name == &quot;article&quot;'>
            <meta expr:content='&quot;Article “&quot; + data:blog.pageName + &quot;”&quot; + &quot; at Form and Formlessness&quot;' property='og:title'/>
        </b:if>
        <b:if cond='label.name == &quot;lists&quot;'>
            <meta expr:content='&quot;Poem list “&quot; + data:blog.pageName + &quot;”&quot; + &quot; at Form and Formlessness&quot;' property='og:title'/>
        </b:if>
    </b:loop>
</b:if>

我的所有帖子都是 poems , articles on poetry ,或诗歌列表,并适当标记。因此,如果我能找到某种方法来访问帖子使用的标签,这应该可行。

如有任何帮助,我们将不胜感激。

附:不必担心代码中的左引号 - 它们是左引号和右引号,并且无需使用 Unicode 值即可正常工作。

最佳答案

前段时间我花了很长时间寻找解决方案。我最终得出的结论(其他人也建议我这样做) data:post.labels 仅在博客文章小部件中可用:如果您在该小部件之外(例如在标题中),则它不可用。

有人确实建议了一些代码,在博客文章中用标签填充数组,然后调用它。但我从未进一步这样做,因为我真的想在到达后置小部件之前访问标签。

我最初的讨论位于:http://www.google.com/support/forum/p/blogger/thread?tid=188cd44d0908f736&hl=en

关于facebook-opengraph - 从标题中修改 Blogger 模板 : Is there some way to access data:post. 标签?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10265536/

相关文章:

javascript - Blogger.com : Can I read <data:post. title/> 包含带有 javascript 的特殊字符

css - Internet Explorer 中的红色边框和框阴影问题

html - Google Plus 共享对话框显示错误图像,使用 OpenGraph 元标记

javascript - Facebook share_open_graph : remove message and change button text

c# - HttpClient PostAsync 到 Blogger API

javascript - 尝试在我流行的帖子小部件中将 Youtube 缩略图从 default.jpg 调整为 0.jpg (我将 imgs 调整为 300px)

oauth - 谷歌 OAuth 的问题

php - 是否可以在同一页面上使用两个 Facebook 应用程序,或者将它们合并为一个?

facebook - 确定用于 Facebook Open Graph 的 URL 的 Object_ID

Facebook 无法识别元数据