如何在每个帖子中实现og:tag? [英] How to implement og:tag in each post?

查看:118
本文介绍了如何在每个帖子中实现og:tag?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的cakephp项目在developer.ctp文件中我实现了og:标签。我已经做了四种类型的。当我添加一个新的帖子,当时我想实现每个帖子应该有如下的标签:

In my cakephp project in developer.ctp file i have implemented og:tags. I have done with four types of this. and when i add a new post, at that time i want to implement that each post should have og tags like this:

<meta property="og:type" content="discussion" />
<meta property="og:url" content="URL" />
<meta property="og:title" content="any title" />
<meta property="og:image" content="any comment"/>


推荐答案

使用属性属性而不是名称属性可以通过将一些特定选项传递给 meta helper:

Creating a meta tag with a property attribute instead of a name attribute can be done by passing some specific options to the meta helper:

$this->Html->meta(array('property' => 'og:title', 'type' => 'meta', 'content' => 'My brilliant page', 'rel' => null));

这篇关于如何在每个帖子中实现og:tag?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆