Jump to:

5450 Posts in 1672 Topics by 1197 members

Customising the CMS

SilverStripe Forums » Customising the CMS » Creating a multi step process in admin

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

Page: 1
Go to End
Author Topic: 225 Views
  • lozhowlett
    Avatar
    Community Member
    140 Posts

    Creating a multi step process in admin Link to this post

    Hi

    I want to create a 3 step process is the admin system, which is going to take some serious customisation.

    Step 1: Select venue and enter event details
    Step 2: Select dates for the event
    Step 3: Select car parks available for event and set pricing

    Is this even possible? Thanks

  • ajthenewguy
    Avatar
    Community Member
    1 Post

    Re: Creating a multi step process in admin Link to this post

    That might actually be pretty easy, just use conditionals on the getCMSFields function, check for fields set, and depending on which ones are already set, present a different set of fields.

    $StepOneFields = new CompositeField(
    new DropdownField('VenueID', 'Venue', Venu::get()->map())
    );

    $StepTwoFields = new CompositeField(
    new GridField('Dates', 'Dates', $this->Dates())
    );

    $StepThreeFields = new CompositeField(
    new GridField('CarParks', 'Car Parks', CarParks::get()->map())
    );

    if( !$this->ID ) $fields->addFieldToTab('Root.Main', $StepOneFields);
    elseif( $this->ID && $this->VenueID ) $fields->addFieldToTab('Root.Main', $StepTwoFields);
    elseif( $this->ID && empty($this->CarParks()) ) $fields->addFieldToTab('Root.Main', $StepThreeFields);
    else // Add all 3 CompositeFields to FieldList

    225 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.