I’m new to Kirby and from what I’ve read the structure field has very limited utility. Is it possible to use the structure field in this way? If so, how would you do it?
An alternative would be to put all sorts of memberships into one structure field with more fields, then you are more flexible anyway. You can then filter your options in your template.
Blueprint:
membershiptypes:
label: Membershiptypes
type: structure
fields:
membershiptype:
label: Type of Membership
type: select
options:
monthly: Monthly
yearly: Yearly
whatever: Whatever Else
commitment:
label: Commitment
type: text
rate:
label: Rate
type: text
To output these in your template, you can then filter by the different types:
$membershipType1 = $page->membershiptypes()->toStructure()->filterBy('membershiptype', 'monthly');
// etc.
you could also access the structure as an array using yaml(). but its less intuitive but has its use when updating a structure programatically. like dividing by half…