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

Named params in filters #25

Open
webhive opened this issue Sep 25, 2016 · 2 comments
Open

Named params in filters #25

webhive opened this issue Sep 25, 2016 · 2 comments
Assignees

Comments

@webhive
Copy link

webhive commented Sep 25, 2016

Here https://help.shopify.com/themes/liquid/filters/url-filters#img_url we can see filter use case:

{{ product.image | img_url: '400x400', crop: 'bottom' }}

so filter accepted named params.

Tried to implement custom filter which work similar, but got an empty string. So I think it could be great to accept named parameters as well as simple strings.

@webhive webhive changed the title Filter named params Named params in filters Sep 25, 2016
@art4ride
Copy link
Collaborator

Hey Roman! Nice catch, looks like a nice idea in future.
And talking about your case I guess you can solve it using

{{ product.image | crop: 'bottom' | img_url: '400x400' }}

to add some info data to image object before casting it to 400x400

@webhive
Copy link
Author

webhive commented Sep 25, 2016

Thank you for support. I have workaround already. Anyway named parameters looks more straightforward method.

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

3 participants