0

I've been trying to find a straight answer to this for over 3 hours now.

I want to have a facebook-share on my site. And to to that I need <meta property> tags. However this is not supported without some special import as I understand it.

What I want:

<meta property="og:url" content="http://samples.ogp.me/136756249803614" /> 
<meta property="og:title" content="Chocolate Pecan Pie" />
<meta property="og:description" content="This pie is delicious!" /> 
<meta property="og:image" content="https://fbcdn-dragon-a.akamaihd.net/hphotos-ak-prn1/851565_496755187057665_544240989_n.jpg" /> 

However this gives the error "Validation (XHTML5) attribute 'property' is not a valid attribute of element meta".

Ive tried changing doctype like in this answer but that did nothing. Ive tried using prefix but that doesn't work either. What am I missing here? I really wish facebook would have a better tutorial for beginners.

All I get when I press share is "Localhost". Even if I specify title, desciption, image etc in meta-tags using "name" instead of "property".

Community
  • 1
  • 1
Green_qaue
  • 3,561
  • 11
  • 47
  • 89

1 Answers1

0

You could use the name attribute instead of property attribute. Facebook lint will throw a warning, but the meta value will still be recognized and parsed.

Example: <meta name="og:title" content="Hello Facebook" />

blackmind
  • 1,286
  • 14
  • 27
  • Thanks, but is there no solution that isnt a workaround? So weird that its this hard when all they talk about is simplicity – Green_qaue Mar 02 '15 at 17:57
  • see the answer from justbeez http://stackoverflow.com/questions/6501189/open-graph-validation-for-html5 – blackmind Mar 02 '15 at 17:58
  • you need the tag . But also depends on which browsers version too – blackmind Mar 02 '15 at 17:59
  • Ye I know I tried that doctype. Still doesnt work. Maybe it wont work since Im running on localhost. Just figured the share dialog would still show me the meta information on localhost. This must work if I have the !DOCTYPE in master page and the share button in a child-page right? – Green_qaue Mar 02 '15 at 18:02