0

I've coded a new fieldtype for my EE3 install. It works, but it doesn't look quite right in the control panel - the input fields only use up half of the available space. This looks fine for many fieldtypes, but I'd rather this stretch across the page, similar to a textarea or grid.

<fieldset class="col-group">
    <div class="setting-txt col w-8">
        <h3><span class="ico sub-arrow"></span>Fieldtype Name</h3>
    </div>
    <div class="setting-field col w-8 last">
        <label for="fto_field_id_21">FieldType Option</label>
        <input type="text" value="" name="field_id_21[fto]">
    </div>
</fieldset>

In Firebug, I can change the class w-8 to w-16 and get the desired look. However, I don't know where in my fieldtype definition I would set that. I dropped the following in my install method:

return array('field_wide' => TRUE);

While it is added to the fieldtype's global settings, it has no effect on how it is displayed in the control panel.

How can I get this full column width fieldtype? Thanks.

1 Answer 1

0

You're close! You need to save the field_wide setting for each individual field. You could either do this via a checkbox/radio setting in your field's display_settings method, or simply hard-code the value in your save_settings method:

function save_settings($data)
{
    return array(
        'field_wide' => 'y'
    );
}
1
  • You really couldn't have made that any easier, thank you! It looks so much better now.
    – Will Diaz
    Sep 6, 2016 at 20:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.