Skip to content

Commit 2da02c9

Browse files
committed
Add og:type if it is missing
1 parent 25e3f29 commit 2da02c9

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/templates/header.inc.phtml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,16 +50,19 @@ if (isset($this->getContext()->user_session)) {
5050
<meta property="og:title" content="<?php echo $title; ?>"/>
5151
<meta property="twitter:title" content="<?php echo $title; ?>"/>
5252
<?php
53-
$ogimage = false;
53+
$ogimage = false; $ogtype = false;
5454
foreach ($this->opengraph as $og) {
5555
$ogkey = $og->getKey();
5656
$ogval = $og->getValue();
5757
if ($ogkey == "image") $ogimage = true;
58+
if ($ogkey == "type") $ogtype = true;
5859
if ($ogkey == "url" || $ogkey == "image") $ogval = Common::relativeUrlToAbsolute($ogval);
5960
?>
6061
<meta property="og:<?php echo $ogkey; ?>" content="<?php echo $ogval; ?>"/>
6162
<?php } if (!$ogimage) { ?>
6263
<meta property="og:image" content="<?php echo Common::relativeUrlToAbsolute("/a/bnetdocs.png"); ?>"/>
64+
<?php } if (!$ogtype) { ?>
65+
<meta property="og:type" content="website"/>
6366
<?php } ?>
6467
</head>
6568
<body>

0 commit comments

Comments
 (0)