I like ExpressionEngine, but I'm starting to doubt its power.
For example, I'm looking for a checkbox fieldtype f开发者_开发问答or custom Member Profile Fields but I'm not finding anything.
Why aren't checkboxes a default option for custom member profile fields?
Is there is a plugin out there or a simple hack for EE2?
if you are asking to be able to set default values to custom channels fields, well, it's not currently possible, and there is no addon to do that. In fact, I tried to create such extension, but I realized that it was not feasible with existing hooks.
You can build it by using the 'cp_js_end' to insert some js in order to add a checkbox, hide the default label and populate it dynamically from the checkbox state with text such 1 or 0, true or false...
Thats how modules such as member categories are made to support non-text fields.
This works on ExpressionEngine v2.2.0.
See the list of php files which you will need (in no particular order)...
- system/expressionengine/views/members/register.php - line 209
- system/expressionengine/views/members/edit-profile.php - line 70
- system/expressionengine/controllers/cp/members.php - lines 2988 and 3086
- system/codeigniter/system/helpers/form_helper.php - get the function names form_radio, form_checkbox, form_multiselect
- system/expressionengine/controllers/cp/myaccount.php - line 309
- system/expressionengine/modals/member_modal.php - line 536 - use foreach on $data array to implode new field arrays.
There are probably a few more pages that need som attention, but this is enough to get going. Any new field types must be created in exp_member_fields.
精彩评论