Skip to content

Instantly share code, notes, and snippets.

@cgi-caesar
Last active March 31, 2021 07:21
Show Gist options
  • Save cgi-caesar/4ce6393f17c49b8e4ef9d11d40b50564 to your computer and use it in GitHub Desktop.
Save cgi-caesar/4ce6393f17c49b8e4ef9d11d40b50564 to your computer and use it in GitHub Desktop.
aMember (site.php): Add Open Graph Meta to Login Page
<?php
Am_Di::getInstance()->blocks->add('login/form/before', new Am_Block_Base(null, 'og-login', null, function(Am_View $v) {
$meta = [
'og:image' => '/path/to/image.png',
];
$out = '';
foreach ($meta as $property => $content) {
$out .= sprintf(
'<meta property="%s" content="%s" />%s',
Am_Html::escape($property),
Am_Html::escape($content),
"\n"
);
}
$v->placeholder("head-start")->append($out);
}));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment