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

Use SEO filenamePattern with named transforms #218

Open
1 of 3 tasks
jessedobbelaere opened this issue Jun 25, 2023 · 1 comment
Open
1 of 3 tasks

Use SEO filenamePattern with named transforms #218

jessedobbelaere opened this issue Jun 25, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@jessedobbelaere
Copy link

I'm submitting a...

  • bug report
  • feature request
  • general question

Steps to reproduce

  1. ...
  2. ...
  3. ...

Description

I have a number of products, each with a gallery of images. For SEO reasons I used the filenamePattern with the product slug.

Because the server has a hard time transforming these images at runtime, I'm looking into automatic transforms, so I'm defining named transforms first. But is it possible to define this customfilenamePattern somehow in the named transform? It uses the page/product slug so even if i'm using 'filenamePattern' => static function ($image) {} that would not help as I only have the image available? And not the entry?

Displayed errors, stack trace, relevant logs

PASTE THE ERROR MESSAGE / STACK TRACE HERE

Additional info

  • Imager version & edition: 4.1.13 PRO
  • Imager transformer:
  • Craft version: 4.4.14 PRO
  • PHP version: 8.1
  • Image driver & version:
@aelvan
Copy link
Contributor

aelvan commented Jun 26, 2023

Hi,

No, unfortunately it wouldn't be possible to use that technique with named transformed and auto generation. I've encountered some similar shortcomings before, and have been contemplating if there's a way to use the element when auto generating base on an element save config. But I didn't come up with a decent solution that wasn't just a big, dirty hack.

I'll leave this open for now and give it some more thought.

@aelvan aelvan added the enhancement New feature or request label Jun 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants