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

Liquid filter for groupby #92

Closed
apexdodge opened this issue Mar 20, 2023 · 1 comment
Closed

Liquid filter for groupby #92

apexdodge opened this issue Mar 20, 2023 · 1 comment
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@apexdodge
Copy link
Contributor

Ideally we have a custom filter that supports groupby in liquid.

Usage would be:

{% assign grouped_items = Target.Items | groupby: "PublishedContent.developer_name" %}
{% for grouped_item in grouped_items %}
    {{ grouped_item.key }}
    {% for item in grouped_item.items %}
        {{ item.PublishedContent.developer_name.Value }}
    {% endfor %}
{% endfor %}

developer_name would be the developer name specified in the config of the field.

@apexdodge apexdodge added the enhancement New feature or request label Mar 20, 2023
@apexdodge apexdodge added this to the v1.0.3 milestone Mar 20, 2023
@apexdodge apexdodge self-assigned this Mar 20, 2023
@apexdodge
Copy link
Contributor Author

Released with v1.0.3

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

1 participant