You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
All documentation examples show single-use case. Would be nice to see a page dedicated to showing how fields/complex fields can be reused. I feel like that's where the real power of this library is. Showing how to do it via functional programming like below as well as a class declaration I'm sure would be helpful to some:
functiongetLinkGroup($name='link'){returnField::make('complex',$name)->add_fields(array(Field::make('text','linktext'),Field::make('text','url'),Field::make('checkbox','newtab'))));}functiongetImageGroup($name='image'){returnField::make('complex','image')->add_fields(array(Field::make('image','mobile'),Field::make('image','tablet'),Field::make('image','desktop')))}functiongetWysiwyg($name='content'){returnField::make('rich_text',$name)}
Container::make('post_meta','Author Info')->where('post_type','=','post')->add_fields(array(getLinkGroup(),getImageGroup('avatar'),getWysiwyg()));
Container::make('post_meta','Call To Action Button')->where('post_type','=','page')->add_fields(array(getLinkGroup()));
The text was updated successfully, but these errors were encountered:
All documentation examples show single-use case. Would be nice to see a page dedicated to showing how fields/complex fields can be reused. I feel like that's where the real power of this library is. Showing how to do it via functional programming like below as well as a class declaration I'm sure would be helpful to some:
The text was updated successfully, but these errors were encountered: