Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow for collapsible, named groups of fields #111

Open
magnetised opened this issue Aug 8, 2016 · 0 comments
Open

Allow for collapsible, named groups of fields #111

magnetised opened this issue Aug 8, 2016 · 0 comments
Assignees

Comments

@magnetised
Copy link
Member

magnetised commented Aug 8, 2016

Currently the only way to group fields is to create a fields-only box.

This is limited because boxes expand sideways and so quickly run out of space.

Instead we should be able to have a vertically expanding set of grouped fields.

Perhaps the fields should be namespaced, so instead of all fields belonging to the instance directly, the access should be as if they belonged to a box. This would allow for repetition of names and would make the transition from field-only boxes easier.

Each field group should be collapsible in the UI (and the collapsed state recorded in the state).

Sketch of syntax:

class Balloon < Page
  field :colour, :string

  fieldgroup :meta do
    field :description
    field :image
  end

  fieldgroup :string do
    field :colour, :string
  end

  fieldgroup :dimensions do
    field :width, :string
    field :height, :string
  end
end

balloon = Balloon.new(colour: "red", string: { colour: "red" })b

balloon.colour #=> "red"
balloon.string.colour #=> "red"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant