Developer forum

Forum » Feature requests » Facebook + eCommerce - OpenGraph tags

Facebook + eCommerce - OpenGraph tags

Nuno Aguiar
Reply
Hi,

We have been asked more and more to have Facebook integrated with Dynamicweb and a big part is eCommerce. Since Facebookis evolving, they are now using the opengraph meta tags, and eCommerce does not provide all the information we need.

The problem is that facebook get's it's information from the cached files, so we cannot change it with javascript, and that meta has to be in the <head> of the document. We have the name and some other info, but not the image.

Would be nice if we could have the product tags (when a looking at a product detail) in the template level, like we have the cart. That way we could use all of the info available.

http://developers.facebook.com/docs/opengraph/

Best regards,
Nuno


Replies

 
Nicolai Høeg Pedersen
Reply
Hi Nuno.

I'll think of some generic solution that can solve this and other equivalent issues.

What about a head tag that can be used in any template, moving its contents head section:

<!--@HeadStart-->
<script src="coolscript.js" />
<meta property="og:title" content="Dynamicweb"/>
<meta property="og:type" content="product"/>
<!--@HeadEnd-->


 
Nuno Aguiar
Reply
Hi Nicolai,

Yes, I imagine this would be a great solution, since it can solve a lot of issues, even loading some css files in specific templates and having everything W3C valid. Perfect!

I would suggest a different tag though, so it does not get mixed up with HeaderStart in Loops.
<!--@DocHeadStart-->
  -- Insert Code here --
<!--@DocHeadEnd-->
And maybe in the template have a tag to activate it, for example:
<head>
  <title>...</title>
  ...
  <!--@TemplatesDocHead-->
  ...
</head>

/Nuno

 
Morten Bengtson
Reply
This post has been marked as an answer
How about using named placeholders, so that we can have more than just one block of content?

I imagine that we could have a module template where we define some block of content and then insert that content whereever we want to - in any template - like a global tag.

Something like this...
<html>
<head>
    <title>Placeholder tags</title>
    <!--@Content(meta)-->
</head>
<body>

MODULE_TEMPLATE_START

    <!--@ContentStart(meta)-->
    <meta property="og:title" content="<!--@Ecom:Product.Name-->"/>
    <meta property="og:type" content="product"/>
    <!--@ContentEnd(meta)-->

    <!--@ContentStart(footer)-->
    <p><!--@Ecom:Product.Name--></p>
    <!--@ContentEnd(footer)-->

MODULE_TEMPLATE_END

    <div><!--@Content(footer)--></div>
</body>
</html>
It would be nice if we could enable debug mode and somehow see where the content came from :)

/Morten
Votes for this answer: 0
 
Nuno Aguiar
Reply
Hi Morten,

Your suggestion is great. I believe that would make it a lot more flexible and clean.

/Nuno

 
Sten Hougaard
Reply
Hi Morten,
This is a great idea! If I understand it correctly you would get options to create named content blocks. Would this mean that could have a sort of "add to content", making it possibel to have the 
<head>
<script>
<!--@Content(scripts)-->
</script>
</head>
<body>
<!--@ContentStart(scripts)-->
alert('hello first time');
<!--@ContentEnd(scripts)-->
..
..
<!--@ContentStart(scripts)-->
alert('hello second time');
<!--@ContentEnd(scripts)-->
</body>
In this case you would get two alerts...

/Sten
 
Martin Nielsen
Reply

+1

Awesome idea.

As Sten wrote, it should support more than one content source, so many modules/templates can write to the same placeholder.

- Martin

 
Dennis Thrane
Reply
So when will this be possible? I’m also struggling with a Facebook like button for ecom.
 
Nuno Aguiar
Reply
Nicolai,

Was this features addressed in DW8 on some level?

Nuno

 
Nicolai Høeg Pedersen
Reply
No - but I have this and several other template improvements on my todo.
 
Jacob Storgaard Jensen
Reply
Hi Nicolai,

This would be highly appreciated in the near future!! More and more customers are "crawing" the og:image tag on products, so we need this soon :-) (Again, I don't do template extenders myself... yet)