This section defines all metatags which are used to have defined in a website. It also contains the most relevant OG-Tags for facebook. It can also be used as an example how to read FAL images related to a page record. Here it is used as og:image
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div xmlns:v="http://typo3.org/ns/FluidTYPO3/Vhs/ViewHelpers" | |
xmlns:f="http://typo3.org/ns/fluid/ViewHelpers"> | |
<f:section name="MetaTags"> | |
{v:resource.record.fal(record: page, field: 'media', table: 'pages') -> v:iterator.extract(key: 'uid') -> v:iterator.first() -> v:var.set(name: 'pageMedia')} | |
<v:page.header.meta name="keywords" content="{page.keywords}" /> | |
<v:page.header.meta name="description" content="{page.description}" /> | |
<v:page.header.meta name="og:title" content="{page.title}" /> | |
<v:page.header.meta name="og:type" content="article" /> | |
<v:page.header.meta name="og:url" content="{v:page.absoluteUrl()}" /> | |
<v:page.header.meta name="og:description" content="{page.description}" /> | |
<f:if condition="{pageMedia}"> | |
<v:page.header.meta name="og:image" content="{f:uri.image(src: pageMedia, treatIdAsReference: 1, maxHeight: 1024, maxWidth: 1024) -> v:format.prepend(add: '{v:page.siteUrl() -> v:format.substring(length: \'-1\')}')}" /> | |
</f:if> | |
<v:page.header.meta name="apple-mobile-web-app-capable" content="yes" /> | |
</f:section> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The helper var.set and v.page.siteUrl are deprecated right now. To make the script working with the current version of vhs (2.1.x) change
and