Hi Gabbsmo,

I've written something very similar to what you are describing for an
otherwise unrelated app, so I'll point you in the direction that I
went.

Copy pages_controller.php from cake/libs/controller/ to app/
controllers/ and make your modifications there.

The trickiest part of leveraging cake's built-in theme support is that
cake expects themes to consist of static files.  You'll need to decide
if you want your app to write these files upon users' submissions (I
wouldn't advise this), or if you want to read them from a database on
each pageload (or read from a db once and dump it into the session).

Here's a very small sample that will allow each theme to have its own
specific pages.  First, we'll check the default pages directory for a
given file, then check the theme-specific directory:

if(
  is_file(APP.'/views/pages/'.join('/', $path).'.ctp') ||
  is_file(APP.'/views/themed/'.$this->theme.'/pages/'.join('/',
$path).'.ctp')
) {
  $this->render(join('/', $path));
}

You can either load and set users' custom CSS/JS/etc here in
pages_controller, or in the app_controller's beforeRender().

Hope this is helpful.

- Jim

--

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=.


Reply via email to