Created
December 9, 2022 08:34
-
-
Save BlackhawkG7/b4024bec1482f29c7c620eccf27a1ff6 to your computer and use it in GitHub Desktop.
TYPO pagelink / typolink with OpenGraph image
This file contains hidden or 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
<v:page.info pageUid="{pageUid}" as="page"> | |
{v:resource.record.fal(table: 'pages', field: 'og_image', record: page) -> v:iterator.first() -> | |
v:variable.set(name: 'ogImage')} | |
<f:variable name="crop">{ogImage.crop -> v:format.json.decode()}</f:variable> | |
<f:link.typolink parameter="{page.uid}" class="{f:if(condition: page.current, then: ' current')}" title="{page.title}"> | |
<f:if condition="{ogImage}"> | |
<figure> | |
<f:image src="{ogImage.uid}" treatIdAsReference="1" cropVariant="feature" maxWidth="364" maxHeight="364" /> | |
</figure> | |
</f:if> | |
<span>{page.title}</span> | |
</f:link.typolink> | |
</v:page.info> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment