Here is where you can get this kind of answer:
http://book.cakephp.org/view/94/views#layouts-96
Create two layout templates and put them in the views/layouts
directory. Lets say:
default.ctp
plain_jane.ctp
Now in your controller action function, add the following:
$this->layout = 'default';
or
$this->layout = 'plain_jane';
And either default or plain_jane will be used.
On Apr 16, 11:48 am, kaffe <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I am new to cake, but I have run into an annoying issue (I have spend
> a few days reading cakephp.org, searching google, reading the IBM turs
> etc).
>
> Heres the deal I have two problems:
>
> I am building a site that has some pages with database content that
> would require models and controllers; but I am also having several
> pages that are static - needless to say they go in: app/views/pages/
>
> For instance: about.thtml, faq.thtml - these pages does IMHO not need
> to go to the database, its only a few Kb of data and I like just doing
> them as plain html.
>
> We can imagine having one layout for a page with many pictures and
> another for a faq that is mostly plain text and just one long column?
>
> Issue:
> How do I load different app/views/layouts/ via app/views/pages/? it
> seems that some stuff has already rendered by the time we get to the
> app/views/pages/ content ... is there a workaround or proper way of
> doing it?
>
> Also, we can imagine that one type of page would require the inclusion
> of a 60 kb Javascript in the layout whereas another page does not need
> to include this...
>
> e.g.
>
> <head>
> <title><?php echo $title_for_layout?></title>
> <link rel="shortcut icon" href="favicon.ico" type="image/x-icon" />
> <script type="text/javascript" src="scripts/mootoolscomp.js"></script>
> <script type="text/javascript">
>
> window.addEvent('domready', function() {
>
> var Tip = new Tips($$('.Tip'));
> var sliders = $$(".slide");
> var triggers = $$(".slide_trigger") ;
>
> triggers.each(function( o, x ){
> var sl = new Fx.Slide( sliders[x], { } );
>
> $(triggers[x]).addEvent('click',function(e){
> e = new Event(e);
> sl.toggle();
> e.stop();
> })
> sl.hide();
> });
> });
> </script>
>
> <?php echo $html->css('main'); ?>
>
> </head><body>
>
> /// versus a non js enabled page being only ///:
>
> <head>
> <title><?php echo $title_for_layout?></title>
> <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
> <?php echo $html->css('main'); ?>
> </head><body>
> <div id="site">
>
> -----------
>
> I am new to this so it might seem trivial, but I would really
> appreciate some help as I am going nuts... ;-)
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---