Open Graph protocol integration
I want to do the integration, is there an easy way to get the first photo of a page from the template?
the idea is to be able to easily add these META:
<meta property="og:title" content="Example title of article"> <meta property="og:site_name" content="example.com website"> <meta property="og:type" content="article"> <meta property="og:url" content="http://example.com/example-title-of-article"> <meta property="og:image" content="http://example.com/article_thumbnail.jpg"> <meta property="og:description" content="This example article is an example of OpenGraph protocol.">
Cheers
Semantic Markups
Comments
Log in or create an account to post a comment.
Re: Open Graph protocol integration
file_link
table tracks all used files of a page.The
external_link
table tracks analog external images.How and where you want determine the image you wanna use? Guess this is the main question, the rest is just code. So we can for example parse / set a file_id as metadata into the page table.
This can be integrated in the properties or attachments handler. On the other hand you can add a additional
og
table and handler, totally independent from the core application./theme/_common/_header.php
/theme/_common/_header.tpl
Re: integration with The Open Graph protocol
But I wanted him to take the first external link of the article and leave it in og_image
I hope that now the idea is understood
Greetings
Re: Open Graph protocol integration
I hope that someone will serve you too, as it is more comfortable to put the automatic photo from the article.
Greetings and thanks for the help.
Re: Open Graph protocol integration
I already thought about a short time hack, until we have a general solution:
A temporary hack for the external image (Does not update the image once written!):
The goal is to parse it only once when the page is saved and store the result in the page table, to load the image with
$this->page
.Now we have two cases, you might have an external image as well as an attached image.
https://example.com/article_thumbnail.jpg
file:/article_thumbnail.jpg
Additionally we want a flexible solution for the description, it can be a text snippet from
$this->page['body']
or just$this->page['description']
.I already looked how it is done in MediaWiki and DokuWiki. None of them deal with external images.
And we want some configurable parameters for the description and the image output.
[... more edits upcoming]
Tools:
Re: Open Graph protocol integration
I have no problem in waiting for a better solution from the team, what I did is just a proof of concept to see the viability of my idea.
Greetings