Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Please make it possible to use assets of related entries as seo image #47

Closed
nilsenpaul opened this issue Mar 29, 2018 · 2 comments
Closed

Comments

@nilsenpaul
Copy link

My setup:

  • Workshops section
  • Workpieces section
  • Workshops has a content relation to/with workpieces.
  • I want the workpiece's image as the SEO image for the workshops.

Is this possible? I can't get this to work, even when I use {entry.workpiece.one.images.one.url} as a customer URL.

@nilsenpaul
Copy link
Author

Ok, sorry, I found the way already:

{{object.entry.workpiece.one.images.one.url}}

But, this way the image doesn't get transformed. Would it be possible to recognize {{object.entry.workpiece.one.images.one}} as an asset, and then using that as a SEO image?

@khalwat
Copy link
Collaborator

khalwat commented Mar 30, 2018

So if you want it transformed, check out the seomatic.helper. functions:

https://github.com/nystudio107/craft-seomatic#helper-functions-seomatichelper

...specifically seomatic.helper.socialTransform. You'd probably want something like:

{{ seomatic.helper.socialTransform(object.entry.workpiece.one.images, "base") }}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants