craft-odds-and-ends
craft-odds-and-ends copied to clipboard
Feature request: Custom Entry Source for Entries (search)
Not an issue, but instead a feature request.
It would be great if it were possible for the Entries (search) field to be able to return entries from a custom entry source of a section. At the moment you're able to set up the field and specify the entry source/section. But if I have a plugin which has registered some custom entry sources within one of the sections, I'd like the field to return only entries from within that custom entry source.
I attempted to do this by adding some JavaScript that manipulates the settings.sources property of the 'elementSelect' data for the rendered field, so it is an array with the handle of a custom entry source rather than the configured section handle. The actionSearchForElements() method correctly received the 'sources' parameter with my custom entry source in it. However, the PHP code that handles the retrieval of results does not account for custom entry sources. It only deals with the field's configured section when building up the element criteria model.
Not sure how much work this would be, but thought it would be worth asking.