Tell me more ×
ExpressionEngine® Answers is a question and answer site for administrators, end users, developers and designers for ExpressionEngine® CMS. It's 100% free, no registration required.

I was able to successfully show a custom field in the Playa list by adding this snippet to the views/entry.php:

<?=$this->db->select('field_id_XX')->where('entry_id', $entry->entry_id)->get('channel_data')->row('field_id_XX')?>

All works well to show and list the custom field, but the filter breaks? Anyone know where I can update the filter to show the correct items when filtering?

UPDATE:

Did a little bit of digging after Alex mentioned the droppanes.js and filter_entries() method and it seems the filtering is done with AJAX as it queries the DB with the playa helper class: system/expressionengine/third_party/playa/helper.php.

share|improve this question
If it is the JS that is breaking I'm guessing it will be in /themes/third_party/playa/scripts/droppanes.js. Can you elaborate a bit on how it breaks (JS erros, behavior, etc)? – Alex Kendrick Dec 12 '12 at 22:44
The filter finds the correct entries if you type a title. If you try searching the custom field I've added, nothing shows/wrong entries. I added the custom field (model #) to the playa list to help differentiate the products (title). So when search for a model #, nothing shows – Siebird Dec 13 '12 at 1:54
Yeah, it looks like the query that is used to build the filtered list isn't going to consider a custom field. The place to start is the filter_entries() method in system/expressionengine/third_party/playa/mcp.playa.php. This gets called every time you type to filter. – Alex Kendrick Dec 13 '12 at 2:57
Thanks Alex. I just took a quick look and I think all the querying is done with system/expressionengine/third_party/playa/helper.php. ...Still beyond my expertise. Maybe someone with PHP chops can chime in. – Siebird Dec 13 '12 at 5:27
1  
I asked this feature to Brandon some time ago, but it seemed to be more complicated than what I thought in the first place. I digged the code myself, but it looks like it's a big hard hack of Playa. – pvledoux Jan 24 at 14:16
show 9 more comments

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.