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.

General Questions

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

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

Is silverstripe suitable for large CRM system


Reply

10 Posts   2676 Views

Avatar
Mo

9 October 2013 at 4:19am Community Member, 509 Posts

Cool, glad to know you are getting somewhere.

As some further light reading, SSBIts has some nice tutorials that might be of use?

http://www.ssbits.com/tutorials/2012/s-new-post-78/

http://www.ssbits.com/tutorials/2010/dataobjects-as-pages-part-1-keeping-it-simple/

http://www.ssbits.com/tutorials/2010/dataobjects-as-pages-part-2-using-model-admin-and-url-segments-to-create-a-product-catalogue/

Cheers,

Mo

Avatar
Optic Blaze

9 October 2013 at 5:40am Community Member, 162 Posts

- Thanks for that i have been working through the SS-Bit tutorials and found it useful.
- Found a really cool module by Uncle Cheese called Bootstrap-forms that uses the twitter bootstrap framework:
http://www.leftandmain.com/silverstripe-screencasts/2012/07/03/bootstrap-forms-for-silverstripe-3/

- The way you set up the forms are brilliant and i find it easier to apply methods to objects using this style.
- One of the cool features is the called FancyDropdown that adds a AJAX style search functionality to a drop down field. I tested it with a list of 1600 postal codes and areas and it works <b>REALLY WELL </b>

The only thing i am struggling with at the moment is populating the form with existing records so that i can update records. I.e if i want to update customer number 3 i want to be able to call something like this in the browser....mysite/customer/edit/3

Which should bring up the form populated with the customer's details.

I know the old way of doing that was something like $form->loadDataFrom($this->editform());

This is what the code looks now:

----------------------------------------------------------------------

//CREATE CUSTOMER FORM
public function CustomerForm() {
return BootstrapForm::create(
$this,
"CustomerForm",
FieldList::create(
TextField::create("Name","Name")
->addExtraClass("required"),
TextField::create("Surname","Surname"),
ChosenDropdownField::create("PostalCodesID", "Postal Addres") ///Fancy Drop down field
->setSource(PostalCode::get()->map('ID','Suburb'))
->setEmptyString('--Please Select--'))
),
BootstrapForm::loadDataFrom($this->editform())
)
}

// ADD CUSTOMER TO DATABASE
public static function AddCustomer($data, $form) {
$submission = new Customer();
$form->saveInto($submission);
$submission->write();
Controller::curr()->redirectBack();
}

}
----------------------------------------------------------------------------

- The module has excellent validation features
- You can do a horizontal layout with checkboxes and radio buttons
- Prepend and apend text to fields
- Customize different buttons to look different...eg submit button is green, delete button is red

And all of this comes out the box!