Using elements is what you want. Inside the elements you can use
requestAction to get at any data you wish to use. You can return an
array of data directly, or render a view. See tutorial here for an
example (and also how to cache the result)

http://bakery.cakephp.org/articles/view/creating-reusable-elements-with-requestaction

Bakery source can be found here:

http://cakeforge.org/projects/bakery/

Additionally, Jonathon Snook uses his own conditionalhelper to render
the elements based on certain conditions.

http://snook.ca/archives/cakephp/elemental_conditional_content_with_cakephp/

Hope this helps.

Adam

On Dec 3, 9:36 am, "Jon Miller" <[EMAIL PROTECTED]> wrote:
> Hi,
> Thanks for your help. I could use Ajax, you're right, but I'm sure
> there must be a simpler way - I just want a single homepage to show a
> list of my music, a list of my articles, and a list of my users, all
> of which come from different DB tables and have different models and
> controllers.
>
> Actually I've just found a much better page to frame my question
> around... see this one:http://bakery.cakephp.org/
>
> Here you have a list of recent articles, a tag cloud of popular terms,
> a list of recent news items etc.
>
> I've never seen a tutorial on how to build a page like this in Cake.
> The most you get might be a page telling you how to make a page that
> lists one of those elements, but not one combining them.
>
> If I was to scaffold each of these I could go to
> bakery.cakephp.org/articles, bakery.cakephp.org/news,
> bakery.cakephp.org/tags etc. and get your CRUD for each of the
> elements, which would give me lots of seperate views, but I've no idea
> how to combine the individual views for these elements into one
> homepage, as most sites on the web do, including lots that claim they
> are built with Cake.
>
> Jon.
>
> On Dec 2, 2007 10:55 PM, ldb <[EMAIL PROTECTED]> wrote:
>
>
>
> > G'day
>
> > Would the Ajax helper be what you are looking for, or have I
> > misunderstood? I did visit your link..........;-)
>
> > On Dec 2, 5:15 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
> > > Hi everyone,
> > > Apologies if this is a silly question, I'm brand new to Cake (and
> > > frameworks in general!).
>
> > > Every tutorial under the sun shows you how to make a view with another
> > > page for editing, another page for adding etc., but nobody seems to be
> > > able to show an example of an everyday web page, with lots of
> > > different dynamic systems built into a single page.
>
> > > I'm thinking of how you'd extend a site wirh a basic layout that looks
> > > like this one:http://www.snook.ca/archives/cakephp
>
> > > Presumably all the ads, book lists and things come from included
> > > elements - I've got that far, but how to make these dynamic? What if I
> > > wanted the left nav to be a list of users, with Edit and Delete links
> > > next to their names, while the main content panel gives me my editable
> > > list of articles. And what if at the bottom of the page I wanted to
> > > display my CD list?
>
> > > I can build a full class for music, articles and users, and they can
> > > work fine seperately (one view for listing my music, in the music
> > > folder, another view for editing my articles, in the articles folder
> > > etc.), but how does one combine them into a single view? I just can't
> > > see what you're supposed to do to combine lots of interactions into a
> > > single page, and where you're supposed to put view files with multiple
> > > functionality. If someone can explain, or point me to a tutorial, I'd
> > > be most grateful!
>
> > > Jon.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to