app_controller
var $view = null;
var $theme = null;
beforeRender
// also add a check for Auth.User later
if(in_array('admin', $this->params)) {
$this->view = 'Theme';
$this->theme = 'admin';
}
then I have a themed directory in views and inside that an admin directory
with layout/default.ctp and also elements/nav/main.ctp etc
works fine for me. Refer to css admin.css with $html->css('admin'); it first
looks for admin.css in the css/ dir then in webroot/themed/(themname)/css/
that works for me.
On 04/04/2008, baal32 <[EMAIL PROTECTED]> wrote:
>
>
> Yeah actually - I read the sanisoft one, the pseudocoder one, and the
> manual page on views (the layouts section)
>
> The sansoft and pseudocoder tutorials don't address how to create a
> theme nor do they give an example. The layouts page in the cake
> manual only has very minimal
> instructions. If I want to theme my pages, what tokens do I need to
> include (other than the ones listed in my original question)? How do
> I refer to my stylesheet? (I know I can do this explicitly with a
> full path in the theme page, but the instructions seem to imply that I
> should place css in webroot/themed/themename/css and that Cake will
> automatically wire it up?
>
>
>
> On Apr 4, 3:37 am, grigri <[EMAIL PROTECTED]> wrote:
> > Have you read this tutorial?
> http://www.sanisoft.com/blog/2007/12/29/theming-your-cakephp-apps-v12/
> >
> > On Apr 4, 12:31 am, baal32 <[EMAIL PROTECTED]> wrote:
> >
> >
> >
> > > I'm very new to Cake and I've been trying to go through the
> > > documentation on theming. The external tutorials I've read indicate
> > > that the theme is set in app/app_controller.php and the theme default
> > > file is in app/views/themed/(themename)/default.ctp - this part
> > > appears to be working for me.
> >
> > > However I'm having a hard time figuring out how to apply css and what
> > > tokens other than $title_for_layout and $content_for_layout are
> > > available. I've placed style.css in /webroot/themed/(themename)/css
> > > yet it isnt being applied. Do I reference it explicitly from
> > > default.ctp or is there some Cake magic that I can invoke?
> >
>
> > > Thanks for any guidance- Hide quoted text -
> >
> > - Show quoted text -
>
> >
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake
PHP" 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=en
-~----------~----~----~----~------~----~------~--~---