Default Domain Route and ModelAdmin Panels on Framework Only Sites

Recently I was tasked with developing a small database driven solution and it sat perfectly in the SS framework being driven by controllers only. No CMS was required and it only had half a dozen classes to produce the structure.

However, during the course of the build some issues became apparent - what happened if a user didn't provide the correct url and back_url in the browser, by default SS would end up in a page offering the user to setup a site, build a controller and other stuff - not very professional when your dealing with office staff at a charity!

So, the way to manipulate SS into doing what I needed ended up being fairly straightforward thanks to some help from a couple of iRC buddies… You know who you are!

Firstly, redirect all calls that don't map to a controller to the AdminRootController:

---
Name: customroutes
After: framework/routes#coreroutes
---
Director:
rules:
'process//$Action/$ID/$OtherID' : 'ProcessController'
'' : 'AdminRootController'

 

Second, it required that the administration didn't default to showing the security tab as this was actually hidden using a leftandmainextension:

AdminRootController:
default_panel: 'ClientAdmin'

 

By choosing a default panel we ended up being able to 'push' the user coming from just '/' to the first (or preferred) modeladmin panel!

Rate this post (1 ratings)

Post your comment

Comments

  • 20/04/2016 5:43pm (1 year ago)

    The `//$Action/$ID/$OtherID'` bit on the process root is not needed as it's the default and will be parsed off automatically anyway.

RSS feed for comments on this page | RSS feed for all comments