tighten / craft-build-query

A plugin for Craft CMS, demonstrating how to build complex or optimized queries by modifying an ElementCriteriaModel.
MIT License
39 stars 3 forks source link

Problem with extending EntryModel #3

Open aelvan opened 8 years ago

aelvan commented 8 years ago

I tried using your trick with extending the EntryModel to add another field (count) to the existing ones. Problem is, if I do it the same way that you do, custom fields are not available in the templates under their usual handle, myCustomField, but as field_myCustomField. Title and count is available as you show in your example, but not custom fields. I tested this with your plugin too, and get the same result.

Any idea if this is possible to fix?

thomasJoei commented 7 years ago

Had the same issue. Remove $model->setContent($value); from the populateModels method. I guess that was used for an older version of Craft