Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

separate admin theme #84

Open
dtan opened this Issue · 4 comments

2 participants

@dtan
Collaborator

per an earlier conversation:
I was considering breaking out the admin functions into an Admin theme (so you can theme both seperately) ... and then ensuring that any URL's exposed by modules that are 'Admin' automatically switch to the admin theme

@cliftonc
Owner

We would have to:

  • create a new theme object under calipso, e.g. calipso.themeAdmin (that just gets loaded the same as the normal theme and is just a new instance of the theme engine)
  • move the current theme to calipso.themeSite (?)
  • add a wrapper class to replace calipso.theme (e.g.acts as an wrapper to either theming back end, where the default is that it renders to the front end - so it works as before in all old modules of calipso.theme.renderItem)
  • then change the router so that whenever the route matched is admin:true (and is not a /.*/ route) that it sets a flag in the response to indicate it should use the admin theme (which is picked up by the calipso.theme wrapper) - this is similar to the way res.layout is set and used. This change would be done in lib/Router.js. ... I think that would do it, but what it does do is create a rule that says: if multiple modules match a route, and any one of those matches is an admin:true route, that it flips to the admin theme. So the admin module wouldn't really change, just use the admin:true property of routes to drive switching of themes, and as a result all of its matched routes would be rendered in the admin theme.

You would probably want to do one more thing, which is provide a helper function in the admin theme that allows it to control rendering of the top / overlay menu on the front end for when an administrator is logged in (e.g. the site theme can call the admin theme to get that menu and render it into the response).

The admin theme wouldn't actually be any different in its configuration, but clearly would have its own CSS, layouts etc. that optimise it for Admin functions - it would then be possible for a theme to be both front end and admin (if you wanted).

Definitely doable!

:)

@dtan
Collaborator

hehe, i'll have to digest this one for a bit

@dtan
Collaborator

it also looks like there should be a separate "admin theme" selector in the administration page.

@cliftonc
Owner
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.