Looks like a combination of layouts and elements. Don't forget you can create 
as many layouts as you want, and specify which one to use in your controller - 
either inside beforeFilter (so that it applies to all functions in the 
controller) or inside a controller function (which will override all other 
settings). The command is $this->layout = '*layout_name*';  '*layout_name*' can 
also be  variable, allowing you precise control.

You can customise your view at runtime by calling an element with a variable - 
echo $this->element($variable); You can also customise your elements at runtime 
by passing in variables - echo $this->element('*element_name*', 
array('variable' => 'value')); - and have your code react internally to the 
variable dynamically.

Here's a few ideas on dynamic menus: 
http://articles.classoutfit.com/2009/11/cakephp-dynamic-navigation-bars/

I'm sure there's lot of other ideas too.

Jeremy Burns
jeremybu...@me.com


On 29 Mar 2010, at 13:49, janitor048 wrote:

> Hi there,
> 
> I'm pretty new to CakePHP (and MVC in general for that matter) and I'm
> just working through the docs etc.
> And since the cookbook is quite informative, I think I've got a pretty
> good idea of what CakePHP could do for me by now.
> 
> However, I would like to ask a question on best or common practice on
> how to actually integrate my pieces of cake with a given design.
> So that I can keep these suggestions in mind when digging even deeper
> into the documentation.
> 
> Say, I've got a webpage that features
> - a main "view" area in the center
> - a main menu at the top that stays constant over all pages
> - a side menu to the left that stays constant over some pages but does
> in general depend on the content of the central area
> - a small side area to the right with some login / admin bits-and-
> pieces.
> 
> Pretty common and probably pretty close to the actual project I'm
> about to work on.
> The general layout as described above I would like to design using
> dreamweaver (for instance) and setting up a css formatted page using
> divs.
> 
> The main toolbar would probably best go into a common cake layout
> file. But what about the rest? View files with elements for left menu
> and login-area on the right? Login stuff as an element and the left
> menu in layout files that are selected by the controller accordingly?
> 
> Can I attach id-based css rules to a specific element created by a
> (say) form helper? For positioning purposes and the like..
> 
> And finally: What is the best way to incorporate bits and pieces from
> different models / controllers into a single view? That would
> something like a summary page, e.g. showing the 5 latests news, the 3
> latest pictures and the most popular comments (or whatever you like)
> in different areas of a single page (as delivered to the user).
> 
> 
> Any hints and suggestions would be highly appreciated.
> Cheers,
> Oliver
> 
> Check out the new CakePHP Questions site http://cakeqs.org and help others 
> with their CakePHP related questions.
> 
> You received this message because you are subscribed to the Google Groups 
> "CakePHP" group.
> To post to this group, send email to cake-php@googlegroups.com
> 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?hl=en
> 
> To unsubscribe from this group, send email to 
> cake-php+unsubscribegooglegroups.com or reply to this email with the words 
> "REMOVE ME" as the subject.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
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?hl=en

To unsubscribe from this group, send email to 
cake-php+unsubscribegooglegroups.com or reply to this email with the words 
"REMOVE ME" as the subject.

Reply via email to