I have a static page that I want to serve so I made a .ctp in the /views/pages/ directory. The problem is that it's using the default layout which I do not want to use. I tried making my own pages_controller and passing the $layout var but that does not work. There has to be a way to tell a /pages/ to use another layout.ctp. No?
A:
few things to check
- make a custom pages_controller.php
- define variable $layout and set it to the layout you want.
- make sure the layout exists in views/layout/
Funky Dude
2010-01-15 20:20:16
I set $this->layout = 'xxx'; in the display function on app/controllers/pages_controller, right?
Selino
2010-01-15 20:43:30
Yes, that's how you do it. Is that pages controller the one being loaded? Check by making a function in it to output something simple, and try to load that url (eg make PagesController::test(), and try to access /pages/test)
Travis Leleu
2010-01-15 23:31:55
Yes, I've been trying that and no avail. It's not passing anything. Everything I had read said that I just place an /app/controllers/pages_controller.php and it would be set. Is there another switch to flip?
Selino
2010-01-16 07:53:20
check route.php in config folder. see if it's rerouted to somewhere else.
Funky Dude
2010-01-16 17:54:55
It's def an issue with my beforeFilter() in my app_controller. I think it's not allowing me to pass any set(var) without authenticating first.
Selino
2010-01-19 06:18:15