Fórumok

Open Graph Meta Tags

Ravi Shah, módosítva 9 év-val korábban

Open Graph Meta Tags

Junior Member Bejegyzések: 59 Csatlakozás dátuma: 2014.01.02. Legújabb bejegyzések
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, módosítva 9 év-val korábban

RE: Open Graph Meta Tags

Liferay Legend Bejegyzések: 1668 Csatlakozás dátuma: 2008.07.15. Legújabb bejegyzések
Hi Ravi

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

cheers!
Ravi Shah, módosítva 9 év-val korábban

RE: Open Graph Meta Tags

Junior Member Bejegyzések: 59 Csatlakozás dátuma: 2014.01.02. Legújabb bejegyzések
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, módosítva 9 év-val korábban

RE: Open Graph Meta Tags

Liferay Legend Bejegyzések: 1668 Csatlakozás dátuma: 2008.07.15. Legújabb bejegyzések
Can you show me your html in the developing tools? Are you escaping the value?