Not sure if your example given for the login was where you intend on
using this.

I would leave the default.ctp as the main header for your site.
Create a special/custom header for your auth/login/register pages.
Something like login.ctp
Then as Chris mentions set $this->layout = 'login"; in the actions of
your auth or user controller for the login and register actions.

You can change set $this->layout from anywhere in the controller.

http://book.cakephp.org/view/1287/Setting-up-the-Layouts

On Apr 18, 3:13 am, chris <chris....@internetlogistics.com> wrote:
> You could use this to change to a different layout file in the
> beforeFilter() method of your app_controller.php file
>
> $this->layout = 'loggedin';
>
> and create a loggedin.ctp file in your layouts directory. This file
> can then look complety different to default.ctp
>
> I have a few different layouts setup dependant on different user types
> I have setup in my application, and switch between them in
> beforeFilter.
>
> On Apr 17, 9:36 am, Chuck <foonl...@gmail.com> wrote:
>
>
>
>
>
>
>
> > thanks!
>
> > Chuck
>
> > On Apr 17, 4:13 am, "Krissy Masters" <naked.cake.ba...@gmail.com>
> > wrote:
>
> > > You could have an if or switch block in the layout to echo an element
>
> > > if($logged_in){
>
> > > echo $this->Element('private_header, array());
>
> > > //1 element header
>
> > > } else {
>
> > > //other header element
> > > echo $this->Element('public_header, array());
>
> > > }
>
> > > K
>
> > > -----Original Message-----
> > > From: cake-php@googlegroups.com [mailto:cake-php@googlegroups.com] On 
> > > Behalf
>
> > > Of Chuck
> > > Sent: Saturday, April 16, 2011 5:23 PM
> > > To: CakePHP
> > > Subject: Anyway to change thedefault.ctpto another header.ctp ?
>
> > > I know this might sound kinda noob.  As I observed, cakephp uses view/
> > > layout/default.ctpas the header and footer.  If I click go to another
> > > page, is there anyway I could use another header instead ofdefault.ctp? 
> > > For example, say I want to change the header completely
> > > after logging in. Anyone point me to the right direction? thanks.
>
> > > Chuck.
>
> > > --
> > > Our newest site for the community: CakePHP Video 
> > > Tutorialshttp://tv.cakephp.org
> > > Check out the new CakePHP Questions sitehttp://ask.cakephp.organdhelp
> > > others with their CakePHP related questions.
>
> > > To unsubscribe from this group, send email to
> > > cake-php+unsubscr...@googlegroups.com For more options, visit this group 
> > > athttp://groups.google.com/group/cake-php

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php

Reply via email to