We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

How to access custom fields from a channel entry in a model query.

How Do I?

Simon 's avatar
Simon
1 posts
one year ago
Simon 's avatar Simon

Hello. I have set up a channel with some custom fields. These fields do not appear with the main properties when performing a model search, they appear to be in the collection object as entities such as ‘field_id_20’. How do I perform a model search and specify a particular field as a filter in my query?

I’m hoping I can do something like: $entries = ee(‘Model’)->get(‘ChannelEntry’)->with(‘field:20’)->all();

Any help or pointers to documentation would be very appreciated.

       
philliprector's avatar
philliprector
3 posts
one year ago
philliprector's avatar philliprector

Hello @ fnaf 2, To perform a model search and specify a particular field as a filter in your query, you would need to access the appropriate model and use the available methods or syntax provided by your CMS or framework.

       
hoaiheo's avatar
hoaiheo
2 posts
one year ago
hoaiheo's avatar hoaiheo

@ fnaf 2 I completely agree with what you suggest here.

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.