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

Image Transforms for getImg() function #3563

Closed
Visiluna opened this issue Dec 15, 2018 · 1 comment
Closed

Image Transforms for getImg() function #3563

Visiluna opened this issue Dec 15, 2018 · 1 comment
Labels
assets 📁 features related to asset management enhancement improvements to existing features site development 👩‍💻 features related to website/API development

Comments

@Visiluna
Copy link

The ability to pass an image transform to an asset's getUrl(), getWidth(), and getHeight() methods is pretty awesome and I use it a lot.

It'd be even more awesomer if you could add the ability to pass an image transform to an asset's getImg() method.

That way, I could write
{{ asset.getImg('transform') }}
instead of
<img src="{{ asset.getUrl('transform') }}" width="{{ asset.getWidth('transform') }}" height="{{ asset.getHeight('transform') }}" alt="{{ asset.title }}">.

Thanks.

@brandonkelly brandonkelly added assets 📁 features related to asset management enhancement improvements to existing features labels Dec 1, 2019
@brandonkelly brandonkelly added this to the 3.4 milestone Dec 1, 2019
@brandonkelly brandonkelly added the site development 👩‍💻 features related to website/API development label Dec 1, 2019
@andris-sevcenko
Copy link
Contributor

This has been added for Craft 3.4!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
assets 📁 features related to asset management enhancement improvements to existing features site development 👩‍💻 features related to website/API development
Projects
None yet
Development

No branches or pull requests

3 participants