-
Notifications
You must be signed in to change notification settings - Fork 16
Using OpenGraph Integration
juliocamarero edited this page Oct 6, 2012
·
3 revisions
If you want your page to be an object in the OpenGraph tree, you just need to do the following:
- Go to "Manage Page" --> Open Graph
From there, you can change the value of any field for your entity.
If you want to your entities in your portlets to be an object in the OpenGraph tree, you need to:
-
Create a view for every entity
-
When displaying the view for the entity, you need to set the following attributes in the request: ` Map<String, String> opengraphAttributes = (Map<String, String>)request.getAttribute( "LIFERAY_SHARED_OPENGRAPH");
if (opengraphAttributes == null) { opengraphAttributes = new HashMap<String, String>(); request.setAttribute( "LIFERAY_SHARED_OPENGRAPH", opengraphAttributes); } opengraphAttributes.put("type", "freezity:event"); opengraphAttributes.put("url", event.getFriendlyURL(themeDisplay)); opengraphAttributes.put("title", event.getTitle());
`
In order to test if your entity is working well you can test it with the OpenGraph Debugger