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

Twig extension: Add functionality to getResizedImage to not include width and height attributes #6

Open
joeholdcroft opened this issue Jan 20, 2014 · 1 comment

Comments

@joeholdcroft
Copy link
Contributor

When you call getResizedImage() within a Twig file, the image tag is rendered with width and height attributes.

This is almost always handy to avoid janky page loading, but in some cases (such as when you're doing something responsive) you don't want this as it's impossible(?) to override with CSS.

You can pass an associative array of attributes as the 4th parameter for this function, but passing width or height would result in two width or height parameters.

Update the code to watch for these attributes, and if they are defined with a value of null, perhaps, don't render the attributes.

@joeholdcroft
Copy link
Contributor Author

This first came up on the Mothership Demo when @aislingbrock was making the carousel responsive.

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

No branches or pull requests

1 participant