留言板

Open Graph Meta Tags

Ravi Shah,修改在9 年前。

Open Graph Meta Tags

Junior Member 帖子: 59 加入日期: 14-1-2 最近的帖子
Hi Everyone,

I am trying to put some open graph meta tags in Liferay's theme. I have used below code:

<meta property="og:title" content="$titleCamp" />


and this $titleCamp is set in the init_custom.vm file as:-

#set($titleCamp=$request.getSession().getAttribute("LIFERAY_SHARED_CAMPAIGN_TITLE"))


Session values are being set from Controller.

The issue here is Facebook is not able to recognize this $titleCamp value. But when i do inspect element in my html page, from that I can see that for og:title tag values are getting set properly. Then why Facebook is not able to parse it.

Is there any other way to pass the velocity variables in open graph tags ? Please help me on this.
thumbnail
Julio Camarero,修改在9 年前。

RE: Open Graph Meta Tags

Liferay Legend 帖子: 1668 加入日期: 08-7-15 最近的帖子
Hi Ravi

I would try to use this tool to see what is wrong with your tag: Open Graph Debugger

cheers!
Ravi Shah,修改在9 年前。

RE: Open Graph Meta Tags

Junior Member 帖子: 59 加入日期: 14-1-2 最近的帖子
Hi Julio,

I am using this tool for debugging. But I don't see any errors for title that i am passing as velocity variable.
thumbnail
Julio Camarero,修改在9 年前。

RE: Open Graph Meta Tags

Liferay Legend 帖子: 1668 加入日期: 08-7-15 最近的帖子
Can you show me your html in the developing tools? Are you escaping the value?