{"action":"created","issue":{"url":"https://api.github.com/repos/michaeluno/admin-page-framework/issues/199","labels_url":"https://api.github.com/repos/michaeluno/admin-page-framework/issues/199/labels{/name}","comments_url":"https://api.github.com/repos/michaeluno/admin-page-framework/issues/199/comments","events_url":"https://api.github.com/repos/michaeluno/admin-page-framework/issues/199/events","html_url":"https://github.com/michaeluno/admin-page-framework/issues/199","id":57546687,"number":199,"title":"Help with custom field type","user":{"login":"baskettcase","id":562340,"avatar_url":"https://avatars.githubusercontent.com/u/562340?v=3","gravatar_id":"","url":"https://api.github.com/users/baskettcase","html_url":"https://github.com/baskettcase","followers_url":"https://api.github.com/users/baskettcase/followers","following_url":"https://api.github.com/users/baskettcase/following{/other_user}","gists_url":"https://api.github.com/users/baskettcase/gists{/gist_id}","starred_url":"https://api.github.com/users/baskettcase/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/baskettcase/subscriptions","organizations_url":"https://api.github.com/users/baskettcase/orgs","repos_url":"https://api.github.com/users/baskettcase/repos","events_url":"https://api.github.com/users/baskettcase/events{/privacy}","received_events_url":"https://api.github.com/users/baskettcase/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":9,"created_at":"2015-02-13T01:27:55Z","updated_at":"2015-02-15T23:30:34Z","closed_at":null,"body":"Hey Michael, me again :) I could really use some help with another custom field type. This is the regular code, but I need it repeatable and sortable, which is why I need it to be a custom field type correct? I've done several custom ones since you helped me last time, but this one is more difficult since a couple of the fields have multiple dropdowns and the custom one that you did that I've been referencing only has input fields and textboxes. Any help would be appreciated! thanks!  \r\n\r\n```php\r\nif ( include( FPP_APF_FIELD_TYPES. 'FPPImage.php' ) ) {\r\n\tnew FPPImageFieldType( get_class( $this ) );\r\n}\r\n\r\n$rotate_dropdown = array();\r\nfor ($i=-10; $i<=10; $i++) $rotate_dropdown[$i] = $i .'&deg;';\r\n$pos_dropdown = array(\r\n\t'none' => 'None',\r\n\t'topleft' => 'Top Left',\r\n\t'topmid' => 'Top Middle',\r\n\t'topright' => 'Top Right',\r\n\t'midleft' => 'Middle Left',\r\n\t'midright' => 'Middle Right',\r\n\t'botleft' => 'Bottom Left',\r\n\t'botmid' => 'Bottom Middle',\r\n\t'botright' => 'Bottom Right'\r\n);\r\n$tape_rotate_dropdown = array(\r\n\t'0' => '0&deg;',\r\n\t'45' => '45&deg;',\r\n\t'90' => '90&deg;',\r\n\t'-45' => '-45&deg;'\r\n);\r\n\r\n$oAdminPage->addSettingFields(\r\n\t#'_default',\r\n\tarray(\r\n\t\t'field_id'\t=> 'image',\r\n\t\t'title'\t\t=> 'Image',\r\n\t\t'type'\t=> 'image'\r\n\t),\r\n\tarray(\r\n\t\t'field_id'\t=> 'rotate',\r\n\t\t'title'\t\t=> 'Image Rotation',\r\n\t\t'type'\t=> 'select',\r\n\t\t'label'       => $rotate_dropdown,\r\n\t\t'default'   => 0\r\n\t),\r\n\tarray(\r\n\t\t'field_id'\t=> 'first_tape',\r\n\t\t'title'\t\t=> 'Tape 1',\r\n\t\t'type'\t=> 'select',\r\n\t\t'before_input' => 'Tape Position &nbsp;',\r\n\t\t'label'       => $pos_dropdown,\r\n\t\t'attributes'    => array(\r\n\t\t\t'field'\t=> array(\r\n\t\t\t\t'style' => 'display: inline; clear: none',\r\n\t\t\t),\r\n\t\t),\r\n\t\tarray(\r\n\t\t\t'before_input' => '&nbsp; Tape Rotation &nbsp; ',\r\n\t\t\t'label'\t=> $tape_rotate_dropdown\r\n\t\t)\r\n\t),\r\n\tarray(\r\n\t\t'field_id'\t=> 'second_tape',\r\n\t\t'title'\t\t=> 'Tape 2',\r\n\t\t'type'\t=> 'select',\r\n\t\t'before_input' => 'Tape Position &nbsp;',\r\n\t\t'label'     => $pos_dropdown,\r\n\t\t'attributes'    => array(\r\n\t\t\t'field'\t=> array(\r\n\t\t\t\t'style' => 'display: inline; clear: none',\r\n\t\t\t),\r\n\t\t),\r\n\t\tarray(\r\n\t\t\t'before_input' => '&nbsp; Tape Rotation &nbsp; ',\r\n\t\t\t'label'\t=> $tape_rotate_dropdown\r\n\t\t)\r\n\t)\r\n);\r\n```"},"comment":{"url":"https://api.github.com/repos/michaeluno/admin-page-framework/issues/comments/74443674","html_url":"https://github.com/michaeluno/admin-page-framework/issues/199#issuecomment-74443674","issue_url":"https://api.github.com/repos/michaeluno/admin-page-framework/issues/199","id":74443674,"user":{"login":"michaeluno","id":3408158,"avatar_url":"https://avatars.githubusercontent.com/u/3408158?v=3","gravatar_id":"","url":"https://api.github.com/users/michaeluno","html_url":"https://github.com/michaeluno","followers_url":"https://api.github.com/users/michaeluno/followers","following_url":"https://api.github.com/users/michaeluno/following{/other_user}","gists_url":"https://api.github.com/users/michaeluno/gists{/gist_id}","starred_url":"https://api.github.com/users/michaeluno/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/michaeluno/subscriptions","organizations_url":"https://api.github.com/users/michaeluno/orgs","repos_url":"https://api.github.com/users/michaeluno/repos","events_url":"https://api.github.com/users/michaeluno/events{/privacy}","received_events_url":"https://api.github.com/users/michaeluno/received_events","type":"User","site_admin":false},"created_at":"2015-02-15T23:30:34Z","updated_at":"2015-02-15T23:30:34Z","body":"> It doesn't look like I need the new version of the class yet since it's working? or are you saying that the settingFields would change with the 3.5.3 that you're talking about?\r\n\r\nThe current posted example plugin above will/should be compatible with v3.5.2 or below but the one I'm going to update and post will not.\r\n\r\n> Is there a way to add the labels that I show in the previous screenshot?\r\n\r\nModify the `_getSelectFieldsOutput()` method in the example plugin. In that method, you see it parses the `select_fields` argument. In that loop, embed your custom output with your preferred custom. And in the `addSettingFields()` method when you define form fields, add your custom argument with your preferred labels.\r\n\r\n> It doesn't look like I can add in custom styles? I was trying to see if I could access the parent's parent class to add custom styles using getStyles(), but it doesn't look like Im able to do that. How would I add in custom styles like I can with the other fieldtypes?\r\n\r\nOverriding `getStyles()` is not working because the `image` field type is not extending `AdminPageFramework_FieldType` but `AdminPageFramework_FieldType_Base` which is what I said in the last reply. It has been fixed in v3.5.3b. You can override `_replyToGetStyles()` method instead or try the 3.5.3b development branch.\r\n\r\n\r\n\r\n\r\n"}}