Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Custom admin screens for car parking app


Go to End


2 Posts   792 Views

Avatar
lozhowlett

Community Member, 151 Posts

23 July 2013 at 2:36am

Not sure how to explain this, i want to create a custom form layout in the admin system, i.e. outside of the scaffolder. Its for a car parking system. The default scaffolder has given me the ability to add venues, and events, eg

The Village Hall (Venue), 70s Disco (event)

But now I need to be able to add multiple dates for the event and select the car parks available

So I want a calendar (easy), then for each date selected on the calendar, you then select the car parks and tariffs available (which are pre loaded in reference tables in the admin system already) with the ability to overwrite the spaces, prices, etc from the reference table.

- Car Park A
---- Tariff A | Spaces | Price | Active
---- Tariff B | Spaces | Price | Active
---- Tariff C | Spaces | Price | Active
- Car Park B
---- Tariff A | Spaces | Price | Active
---- Tariff B | Spaces | Price | Active
---- Tariff C | Spaces | Price | Active

Etc

So the question is, how do I build forms/screens in the admin that do not use the scaffolder? Instead they use a completely custom layout and post data back at silverstripe to then populate the DB?

Thanks for any help!

Avatar
Willr

Forum Moderator, 5523 Posts

24 July 2013 at 8:13pm

In your getCMSFields() you would need to create your new functionality with new form fields, i.e you could encapsulate your Carpark selector in a custom form field class 'CarkparkSelectFormField' . New FormField types can specify the custom javascript / html / css your form needs and be included inside the standard CMS.

If you're looking at going completely custom and don't want to include any of the admin interface around the form, then your best bet is to create a new controller and build a front end version of the form which then you can use a custom form template without having the bulk of the CMS.