On 05/09/2021 22:26, Simon wrote:
> Thanks very much, my wording was very loose.
>
> The instructions say" Include the JavaScript SDK on your page once,
> ideally
> right after the opening body tag."
This can be added in the skin template file, right after the opening
body tag.
Alternatively, you may want to create a markup rule and place that in
your GroupHeader page. It will not be right after the opening <body> tag
but close, and will be more configurable from within the wiki.
Their SDK script has the attributes "async" and "defer", that means it
is run in very low priority, and not at any precise point in time.
I see that you can embed the posts in a simpler iframe, see attached
screenshot. It may be easier to maintain this way, and no need for the
full SDK.
Something like this may work:
Markup('fbpost', 'directives', '/\\(:fbpost (.*?):\\)/', 'FmtFBPost');
function FmtFBPost($m) {
$fmt = '<iframe
src="
https://www.facebook.com/plugins/post.php?href='
. '{$url}&width=500&show_text=true&height=273&appId"
width="500" height="273" style="border:none;overflow:hidden"
scrolling="no" frameborder="0" allowfullscreen="true"
allow="clipboard-write; encrypted-media; picture-in-picture;
web-share">'
.'</iframe>';
$url = trim($m[1]));
$html = str_replace('{$url}', rawurlencode($url), $fmt);
return Keep($html);
}
Then in a wiki page, you use:
(:fbpost https://[full url of the post]:)
From their example, I only escaped the special character & to & and
removed the "autoplay" permission. You can probably start from here.
Petko