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.

Customising the CMS /

Custom pages to manage external database


Reply


4 Posts   1157 Views

Avatar
tallrobphilp

Community Member, 9 Posts

13 July 2011 at 10:58pm

First off - generally very impressed with Silverstripe, one of very few "true" CMS that actually have data modelling and a clean separation from template layer, so congrats to the developers.

Basically we are considering rebuilding a site which has a huge and complex database, and I'm not convinced it's a realistic proposition to try to migrate the whole thing to Silverstripe data model. However, if I could utilise the excellent Silverstripe API to essentially create CRUD interface to an external database that would be great.

Is this a realistic idea? For example, create a page that lists thousands of records from external DB in a grid in the same format as would be displayed with ModelAdmin? And then allow editing of individual records in style of Silverstripe but with data going back and forth to external DB.

Many thanks in advance.

Avatar
zenmonkey

Community Member, 532 Posts

15 July 2011 at 6:39am

That would be possible, but migrating the database might be easier using a Custom CSV importer http://doc.silverstripe.org/sapphire/en/howto/csv-import

I've used it to create product Databases and even automatically populate the Image relations. Granted I've only done it on DBs of 1200 records. I'm even using silverstripe to create DBs for iPhone apps this way

Avatar
tallrobphilp

Community Member, 9 Posts

16 July 2011 at 1:24am

Thanks for the CVS import link, might be an option even though our DB is very big and complex.

However, what I'm really interested in is the general idea of having custom CMS pages, how to have forms, list data, how to go about getting a form to post to the back-end, process, and then return some data back to the page etc.

I suppose it's as much about understanding the MVC and executionj pipeline so I can learn how to add these custom pages. We would need to add a lot of custom pages to match up to the functionality of current homebrew CMS.

Are there good tutorials that cover custom CMS pages that aren't jsut about plain model CRUD? Something to show how to create a form, post the data to a controller etc?

Avatar
zenmonkey

Community Member, 532 Posts

16 July 2011 at 2:02am

There may be some good starting points on http://ssbits.com, plus the regular tutorial section has a good simple form tutorial http://doc.silverstripe.org/sapphire/en/tutorials/3-forms

Plus the two books are helpful.

What you're looking for is actually relatively easy to implement in SS. Well compared to building a CMS from scratch :) since SS has some pretty robust tools for forms. And if you can't find the code you need on SS Bits or in the modules the Forums and IRC are your best resource.

Good Luck