-
Notifications
You must be signed in to change notification settings - Fork 638
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Bug: without filter doesn't really filter out anything #3137
Comments
craft.app.sites.getAllSites() will give you an array of craft\models\Site objects. If you drop the {% set otherLocales = craft.app.sites.getAllSites()|without(currentSite) %} |
Yes, I also tried it without the |
Sorry, you’re right, |
Thanks! |
Description
When trying to get all the sites except for the current one, you should be able to filter it out like so:
{% set otherLocales = craft.app.sites.getAllSites()|without(currentSite.id) %}
.However, the
|without
filter doesn't filter out anything. This will still give you a list with all the current sites.Steps to reproduce
{% set otherLocales = craft.app.sites.getAllSites()|without(currentSite.id) %}
Have tried it as such :
{% set otherLocales = craft.app.sites.getAllSites()|without(currentSite) %}
, but with the same result.Additional info
The text was updated successfully, but these errors were encountered: