Is it possible for you to create multiple layouts and set var $layout = "alternate" in your controller?
You could share headers and footers etc between the layouts by using elements. It's also possible to change the layout dynamically in your view, or set variables for your layout from inside the view. Hope that gives you some ideas. Cheers, Adam On Oct 9, 1:53 am, Marc Campeau <[EMAIL PROTECTED]> wrote: > Hi all, > > I've been wondering if it is possible to use sub-layouts with my > views. Let me explain what I mean by "sub-layout": > > I've got a layout/default.ctp setup to display header, content and > footer for the whole website. The body part is just a big div where > all the controller/action views are rendered. Now, I would like to use > a sub-layout within the content zone that, this sub-layout is > controller specific, for instance I have a controller that needs to be > rendered using a two column layout and another one with three columns > regardless of the action being performed by the controller. > > I don't want to duplicate the controller specific layout to all the > different controller/action views which is why I'm thinking a sub > layout would be appropriate, rather than elements. > > Here's what I want to achieve: > In default.ctp: > ---- > header code layout > begin content code layout > $content_for_layout > end > footer code layout > > Where $content_for_layout is such that: > --- > begin controller specific layout > view controller/action > end > > Do I make sense? Am I splitting hairs? Is it possible? How should I go > about this? > > Thanks for your input, > > Marc --~--~---------~--~----~------------~-------~--~----~ 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=en -~----------~----~----~----~------~----~------~--~---
