Skip to content

Custom Field Types in Admin #131

Description

@bitstarr

I have a non gpm news (blog) plugin which is based on flex objects (for reasons of better overview as with the classic pages way).

I use a custom field type to show a checkmark if a value is set in the list in the admin. In the edit its a datetime field.
This is not working anymore in admin2.

Image Image

Have a look into the code:

list:
https://github.com/bitstarr/grav-plugin-news/blob/main/blueprints/flex-objects/news.yaml#L57

edit/form:
https://github.com/bitstarr/grav-plugin-news/blob/main/blueprints/flex-objects/news.yaml#L233

admin specific custom filed template:
https://github.com/bitstarr/grav-plugin-news/blob/main/admin/templates/forms/fields/news-isset/edit_list.html.twig
https://github.com/bitstarr/grav-plugin-news/tree/main/admin/templates/forms/fields/news-datetime

They also do not render correctly in the edit view (note that the date fields shoul also be togglable).

Image

This is surely a quite specific issue of my way hacking into the interface of the old admin.
But maybe it also illustrates use cases that can be considered for admin2 and flex-object plugin improvements.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions