Get records with specific selected select-type value

Open
#1,163 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
30/100
Issue type
Documentation
Clarity
Needs clarification
Activity status
Stale
Tech stack
php
Domain
documentation

Research direction

Start with the Bolt filtering/query documentation and the internships.city select configuration shown in the issue. Confirm the documented query syntax for matching one exact selected city, and record a working example whose results contain only matching internships.

Written by the indexing model from the issue text.

Description

question

So I have a content type of regions:

regions:
    name: Regions
    singular_name: Region
    fields:
        r_id:
            type: number
            mode: integer
            required: true
        title:
            type: text
            class: large
            required: true
        slug:
            type: slug
            uses: r_id
    record_template: region.twig
    listing_template: regionList.twig
    listing_records: 20
    records_per_page: 20

And I have a contenttype of internships that uses the above:

internships:
    name: Internships
    singular_name: Internship
    fields:
     ...
        city:
            type: select
            label: City
            values: regions/{title}
            sort: title
            autocomplete: true
            required: true
        ...
    relations:
      ...
   ...

In my webapp I need to filter entries by city. How do I write the filtering query to select all internships where selected city is exactly one of the list?

Dominant language
PHP
Stars
45
Forks
189
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from bolt/docs

All issues in bolt/docs

Similar issues

More PHP issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.