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

How to search Addresses in Matrix Blocks? #102

Open
lindseydiloreto opened this issue Jan 24, 2024 · 0 comments
Open

How to search Addresses in Matrix Blocks? #102

lindseydiloreto opened this issue Jan 24, 2024 · 0 comments
Labels
Documentation Improvements or additions to documentation

Comments

@lindseydiloreto
Copy link
Collaborator

lindseydiloreto commented Jan 24, 2024

This has come up a few times, and there's never been a concrete answer...

When the Addresses are stored within a Matrix field, what is the correct way to do a proximity search?

There is a lesser-known query method for craft.matrixBlocks, but it doesn't work with orderBy('distance').

✅ {% set matrixBlocks = craft.matrixBlocks.all() %}
❌ {% set matrixBlocks = craft.matrixBlocks.myAddressField(options).orderBy('distance').all() %}

If we can crack it, I'll be happy to document the solution.

@lindseydiloreto lindseydiloreto added the Documentation Improvements or additions to documentation label Jan 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

1 participant