The Stack Overflow podcast is back! Listen to an interview with our new CEO.

Questions tagged [filtering]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1
vote
1answer
21 views

Order grouped results by dropdown order

Following this topic, I have an additional question. The results are not ordered by the order of the Dropdown Options. How can I get this done? Code: {% set players = entry.myPlayersMatrix %} {% ...
1
vote
0answers
17 views

Filtering Entries based on Amenities (Category)

Hello and thank you in advance. I have a page that lists hotels by region. On the initial load of the page I am able to render all the hotels by region in a tabbed format. This part of the page works ...
1
vote
1answer
22 views

How to use checkboxes to filter categories on the front end?

i am trying to filter the various categories i have. Currently my url formats the following : www.site.com/news?cat=industry-news&cat=architecture-design I understand that i have to change this ...
1
vote
1answer
162 views

Arrow functions in twig or craft cms

I tried to use reduce function in template, but got error. It seems twig/craftcms can not work with such functions. Reduce function docs: https://docs.craftcms.com/v3/dev/filters.html#reduce My ...
4
votes
1answer
111 views

How to order or filter entries by their author's custom field?

Is it possible to order and/or filter all entries from a section whose author has a custom field value that is set to "X"? Below is the starting code. in Twig: {% set elementQuery = craft.entries()...
1
vote
1answer
162 views

Filter Entries by Category fields & refresh URL and list with AJAX

I'm finding myself stuck with filtering entries that are related to categories using a category field. I'm looking to build a sub-navigation on a page, where I can select from a select field or from a ...
1
vote
1answer
38 views

How to filter entries by tags array using ['or'] and by category not using or

This works for filtering by tag array {% set relatedToParam = ['or'] %} {% for id in selectedTagIds %} {% set relatedToParam = relatedToParam|merge([{ targetElement: id }]) %} {% ...
1
vote
1answer
168 views

Product Filtering with Tags

I've built a product filtering system using tags and currently have 2 available tag groups under different fields. Size and Type Currently if I select 1 tag from both size and type, it shows all ...
0
votes
0answers
31 views

Using relatedTo with a string of category ids

I have got a list of product variants being filtered by a string of category ids if there is some data in the category parameter with the following code: (Note that I'm using the + character between ...
1
vote
1answer
54 views

filter matrix blocks by multiple light switch value, and then merge them

I have a (Craft 3) matrix field with two different block types that each have a similar light switch field that I want to use to create anchor links on my page. I need to be able to test whether any ...
2
votes
2answers
403 views

Filter entries by Field value using a variable

How do I filter a list of entries by the value of a field using the value of a variable? e.g. {% set location = block.locationVacancies %} {% set entries = craft.entries.section('careers').search('...
1
vote
2answers
149 views

Filtering by categories AND tags with full match

We're trying to filter by categories AND tags in the one form. However can't seem to get things working as we would like. Essentially, we have a form that pulls in the tags and allows multiple ...
1
vote
0answers
74 views

Redactor has destroyed my mailto links, now what?

I migrated from EE > CraftCMS. The email links in my EE WYGWAM fields were encoded as JS. When we imported to CraftCMS we lost all of those links. They now look like this: <a>joe@schmoe.com</...
1
vote
0answers
361 views

How can I filter with facets in algolia with nested structures?

I have a site that currently uses a structure where we have a parent entry and children under it. On the parent page we have entries that have been created with matrix blocks. The structure is as ...
1
vote
2answers
281 views

Sort entries by time part only of DateTime object

I am trying to filter and sort show entries by what time they begin display the current show I have two fields, startTimeand endTime, and while Craft lets me display only the time part in the ...
1
vote
1answer
374 views

Pass 'not' category.id to relatedTo in Craft

I have a search page that filters with these params: {% set results = craft.entries({ section: 'properties', price: range, search: query.location, relatedTo: status, order: ...
1
vote
1answer
278 views

How can I filter Craft Commerce products by the current price

Building on from this question How can I filter Craft Commerce products by price I have a price filter in the store Using this code works fine for the normal price {% set queryParams = { ...
2
votes
1answer
468 views

Only show entries related to category

I am trying to create a category template that shows all entries to show relating to the categories. At the minute the cats are Industry Chemical Medical
1
vote
1answer
506 views

How can I filter Craft Commerce products by price

I'm trying to use price as a parameter for filtering my Craft Commerce products, but I cannot get it to work. I think the problem is with the way that I'm referring to the product price, but at the ...
1
vote
0answers
291 views

How to add pagination to a filtered category output?

I've been able to successfully filter a set of entries by category, and also include pagination for the complete set of entries (in this case so 6 are displayed per page). But once a category filter ...
2
votes
1answer
363 views

Display entries that meet multiple tag params

how would I go about setting up a route and twig template to filter by multiple tags? Example URL scheme: example.com/tags/tag1/tag2/tag3 where tag1, tag2 and tag3 are tags defined in a tag field ...
4
votes
1answer
256 views

Filtering on related entries (with an array query param)

I'm getting myself into a potential pickle here and wanting to know the best way to get apply filters on the current scenario: I have a central business section which is getting populated via an API (...
6
votes
3answers
10k views

Filter Entries by Field Value

How do I filter a list of entries by the value of a field? For example, if I have a lightswitch field called "Featured", how do I output just the featured entries?