Hello,
I need to build a page on a Silverstripe 3.1 site that does a search through an external database containing information on lots of documents. For various reasons, it is not possible to move this database into the SS database. I am trying to use a SS form to pass in the search terms, but I am having some trouble.
I have created a page for /community/library/ in the UI. This UI references a custom LibraryPage, LibraryPage_Controller, and template in LibraryPage.ss. I am able to successfully open /community/library and get a long readout of my library entries . The hard part is implementing the search.
- Following the "Forms" tutorial, I tried to implement a form handler like the "doBrowserPoll" function. However, I find that my function is only invoked with one argument, instead of two as depicted in the tutorial. I can't find any general documentation for form handlers. Am I missing something?
- Suppose I redirect from my form handler back to the main /community/library page. I would need to somehow get my arguments in, either using POST or GET arguments or else using the SS routing system. Any of the three is fine with me. Is it possible to "redirectBack" to another page and carry those arguments with me? If so, where will those arguments appear?
- As for the routing system: I can't seem to get my routes right. Just to test things, in mysite/_config/routes.yml I have defined a rule as such: 'community/library//$action/': 'LibraryPage_Controller' -- but this seems to do nothing. Is there a way to see all the routes which have been already defined? I can define an arbitrary route to a new section of the site, but it seems that if the route is set up in the UI, I can't then create sub-routes inside my routes.yml. (I am using the "templatable" plugin for multiple language translations, if it matters.)
Thanks for any help you can provide. I'm an experienced PHP developer and have used various MVC frameworks before, but I'm new to Silverstripe.
Cheers!