3

Unless I'm missing something, it seems like it is impossible to search by ID in the CP (and therefore via ElementCriteriaModel's search).

I know you can make it sortable using modifyEntrySortableAttributes, but it still doesn't make it searchable.

I've also tried id::"123", which doesn't work.

Any way to do this?

2

If you analyze POST request you will see this:

enter image description here

To get items by id you need to create custom request and add criteria[id]=(int id here) e.x. use this

It is most likely related to the way how ElementCriteriaModel works (99% sure) :

craft.entries({
    id: 123, // search by ID*
    search: 'search query'
})

search by ID*

craft.entries returns ElementCriteriaModel - Source

You won't be able to use default CP search form to get entries by ID

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.