Fellow Magnolians!

Last days, we are facing an i...nteresting issue in our projects, namely a 
problem with the (Facebook's) Open Graph (OG) tags[1]. Our clients want to 
embed better Social Media binding into their pages, and while Twitter is fairly 
easy, Facebook is a tough proposition.

The problem is, that OG Tags must be embedded into the <header> part of the 
page, because they are actually <meta> tags, and they must be present in the 
HTTP response body, not set later using some Javascript. But in the moment of 
rendering the html header, I do not know, what content is going to be rendered, 
do I? 

Well, if the page is "static", I could extend the Page Properties dialog, put 
the required info there, and use it the same way as the page title etc. are 
displayed.

The headache starts when I have a page with dynamic content, let's say a 
product catalog. Then I have a page, e.g. http://my.customer.com/product.html 
which contains a Product component, rendering a product information according 
to a product code provided as request parameter. With a bit virtualURIMapping, 
I could have nice URLs like http://my.customer.com/product/productCode1, 
http://my.customer.com/product/productCode2 etc.

Our client wants, that the OG tags in the page are set according to the 
displayed product, so if someone shares the page to Facebook (via pasting the 
URL, not using the "Share" button eventually embedded into the page), the 
proper product information and picture will be displayed in that FB post.

So far, we've come to the conclusion, that we have to create a special 
PageModel for such pages, search the page's non-page subnodes, if the contain a 
definition of a concerned component, instantiate and execute the component, get 
the OG tag values (provided that our component already supports them), and use 
them in rendering the page header.


To be honest, I don't like the solution at all, but does any of you have a 
better idea?    


Best regards,

Jozef.


[1] Short summary at http://davidwalsh.name/facebook-meta-tags

-- 
Context is everything: 
http://forum.magnolia-cms.com/forum/thread.html?threadId=0999d41a-22d6-4d62-806c-0b5aaf28a627


----------------------------------------------------------------
For list details, see http://www.magnolia-cms.com/community/mailing-lists.html
Alternatively, use our forums: http://forum.magnolia-cms.com/
To unsubscribe, E-mail to: <user-list-unsubscr...@magnolia-cms.com>
----------------------------------------------------------------

Reply via email to