Message Boards

Open Graph Meta Tags

Ravi Shah, modified 9 Years ago.

Open Graph Meta Tags

Junior Member Posts: 59 Join Date: 1/2/14 Recent Posts
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, modified 9 Years ago.

RE: Open Graph Meta Tags

Liferay Legend Posts: 1668 Join Date: 7/15/08 Recent Posts
Hi Ravi

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

cheers!
Ravi Shah, modified 9 Years ago.

RE: Open Graph Meta Tags

Junior Member Posts: 59 Join Date: 1/2/14 Recent Posts
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, modified 9 Years ago.

RE: Open Graph Meta Tags

Liferay Legend Posts: 1668 Join Date: 7/15/08 Recent Posts
Can you show me your html in the developing tools? Are you escaping the value?