ModelAdmin in SilverStripe 2.3

Loading...

Flash Player 9 (or above) is needed to view presentations.
We have detected that you do not have it on your computer. To install it, go here.

6 comments

Comments 1 - 6 of 6 previous next Post a comment

  • + guest996030 guest996030 8 months ago
    Great architecture for a feature that puts Silverstripe WAAAYY ahead of the rest.

    A bit more complete explanation of the relation of code to user’s visual experience (ex. slide 26) would be a welcome addition. Don’t forget the *.ss stuff.
  • + Brice21 Brice Le Blevennec 8 months ago
    @chillu : No error message, but no output similar to your slide 26.

    Where would you call the function Page->HostingTypes() ?

    Can you insert this function call using the CMS administration tools ?
  • + chillu chillu 8 months ago
    @Brice21: Do you get any error messages? The example code has some output on 'our hosting deals' on slide 26. I didn’t include any template logic, just a custom getter in Page->HostingTypes() - so you’ll have to generate this output yourself through <% control HostingTypes %> etc.
  • + Brice21 Brice Le Blevennec 8 months ago
    Great tutorial, I run version 2.3 with your MyCRM demo and I can’t get anything to show on the public site.
  • + samsungln52a850 samsungln52a850 8 months ago
    great slideshow... thanks for sharing
  • + guestdfa17 guestdfa17 8 months ago
    cannot see this show
Post a comment
Embed Video
Edit your comment Cancel

Notes on slide 1


Talk briefly about the CMS.



























7 Favorites & 1 Group

ModelAdmin in SilverStripe 2.3 - Presentation Transcript

  1. ModelAdmin SilverStripe’s great new tool for building CRMs (and other things) Monday, March 2, 2009
  2. We develop a CMS Monday, March 2, 2009
  3. We do other stu too! • Most of our sites include a CMS • But also: CRM, event management, e-commerce, internal business systems • The CMS paradigm doesn’t fit all of these Monday, March 2, 2009
  4. Let’s build a CRM! • We’ve made CRMs for SilverStripe ... several, in fact • Each time we had a “CRM” customer, it seemed that they wanted something dierent Monday, March 2, 2009
  5. Flexible Data, Fixed UI • Clients are very specific about data and business logic • But not about user interface - as long as it’s good, they’re happy • SilverStripe CMS exploits this by making it easy to create new Page Types with custom fields Monday, March 2, 2009
  6. From CMS to DMS • Can we apply this concept to CRM? • Don’t just manage Content • Manage any kind of Data Monday, March 2, 2009
  7. ModelAdmin • Data Management built into SilverStripe • ModelAdmin gives you a CRUD interface around any data: Search, Results, Detail • Same building blocks as CMS interface Monday, March 2, 2009
  8. ModelAdmin • Search on fields linked by relations • Detail record gives you a scaolded interface for editing all relations Monday, March 2, 2009
  9. Monday, March 2, 2009
  10. Monday, March 2, 2009
  11. Monday, March 2, 2009
  12. Code Demo Monday, March 2, 2009
  13. Random example: A small webhosting company with products, customers and contracts * Web2.0ified by http:// creatr.cc Monday, March 2, 2009
  14. Our Datamodel HostingContrac Customer HostingType t has_many has_one Monday, March 2, 2009
  15. HostingType <?php class HostingType extends DataObject { static $db = array( 'Title' => 'Text', 'Description' => 'Text', 'Price' => 'Float', ); static $has_many = array( 'HostingContracts' => 'HostingContract', ); } ?> mysite/code/HostingType.php Monday, March 2, 2009
  16. HostingType Monday, March 2, 2009
  17. HostingContract <?php class HostingContract extends DataObject { static $db = array( 'ContractNumber' => 'Varchar', 'StartDate' => 'Date', 'EndDate' => 'Date' ); static $has_one = array( 'Customer' => 'Customer', 'HostingType' => 'HostingType', ); } ?> mysite/code/HostingContract.php Monday, March 2, 2009
  18. HostingContract Monday, March 2, 2009
  19. Customer <?php class Customer extends Member { static $db = array( 'CustomerType' => \"Enum('Private,Business','Private')\" ); static $has_one = array( 'Avatar' => 'Image', ); static $has_many = array( 'HostingContracts' => 'HostingContract' ); } ?> mysite/code/Customer.php Monday, March 2, 2009
  20. Monday, March 2, 2009
  21. MyCRMAdmin <?php class MyCRMAdmin extends ModelAdmin { protected static $managed_models = array( 'Customer', 'HostingContract', 'HostingType' ); static $url_segment = 'mycrm'; // will be linked as /admin/mycrm static $menu_title = 'My CRM'; } ?> mysite/code/MyCRMAdmin.php Monday, March 2, 2009
  22. Some tweaking... Monday, March 2, 2009
  23. Summary Fields <?php class Customer extends Member { // ... static $summary_fields = array( 'FirstName', 'Surname', 'CustomerType' ); } ?> Monday, March 2, 2009
  24. Searchable Fields <?php class Customer extends Member { // ... static $searchable_fields = array( 'FirstName', 'Surname', 'HostingContracts.ContractNumber' ); } ?> Monday, March 2, 2009
  25. getCMSFields() <?php class Customer extends Member { // ... function getCMSFields() { $fields = parent::getCMSFields(); $fields->removeByName('Locale'); return $fields; } } ?> Monday, March 2, 2009
  26. Using Data on Monday, March 2, 2009
  27. SilverStripe 2.4 and beyond • New data mapper • Thinner, reusable controllers • “Intelligent data” Monday, March 2, 2009
  28. Thank you Download this talk at: http://www.slideshare.net/chillu/modeladmin-in-silverstripe-23 Code (requires SilverStripe 2.3+) http://silverstripe.org/assets/presentations/2009-02-28- modeladminpresentationmysite.zip Ingo Schommer, SilverStripe Ltd., ingo@silverstripe.com License: http://creativecommons.org/licenses/by-nc/3.0/nz/ Monday, March 2, 2009

+ chilluchillu, 9 months ago

custom

5041 views, 7 favs, 4 embeds more stats

SHDH Wellington March 2009 (http://shdh.co.nz)

More info about this document

CC Attribution-NonCommercial-ShareAlike LicenseCC Attribution-NonCommercial-ShareAlike LicenseCC Attribution-NonCommercial-ShareAlike License

Go to text version

  • Total Views 5041
    • 5033 on SlideShare
    • 8 from embeds
  • Comments 6
  • Favorites 7
  • Downloads 94
Most viewed embeds
  • 4 views on http://www.slideshare.net
  • 2 views on http://static.slidesharecdn.com
  • 1 views on http://www.roart.at
  • 1 views on http://www.blackenterprise.com

more

All embeds
  • 4 views on http://www.slideshare.net
  • 2 views on http://static.slidesharecdn.com
  • 1 views on http://www.roart.at
  • 1 views on http://www.blackenterprise.com

less

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate. If needed, use the feedback form to let us know more details.

Cancel
File a copyright complaint
Having problems? Go to our helpdesk?

Categories

Groups / Events