I've got it all working now. One of the issues I was having was with directory paths not resolving correctly as my URL got deeper. So as an example www.tolerase.com/posts worked fine but as soon as I added a forward slash www.tolerase.com/posts/ or a different page www.tolerase.com/posts/view/3 the directory paths weren't resolving correctly so I'd either get an error or my images were showing up as broken/missing images.
The problem was that I was using webroot as part of my directory path so I was unnecessarily taking the path outside of the root and trying to dig into the root. So for instance, I was using the path <i>../../ webroot/templates/masthead.php</i> when I should have just been using the path <i>templates/masthead.php</i>. In trying to resolve the issue I discovered that rather than locating my chunks in my "templates" directory under webroot, that I'd be better served by creating them as "elements" and placing thing in the views/elements directory. Placing them here will allow Cake to automatically cache them in the users browser which will increase the overall performance of my site as a user browses through it. On Oct 9, 3:33 pm, brianfidler <[EMAIL PROTECTED]> wrote: > Ok, one thing I'm running into when I use the default.ctp layout is > that it works for the top layer view but not more detailed views... > > so the website I'm working on is:http://www.tolerase.com/posts > > In this view the layout is rendering the content within my default > layout, however if I try to viewhttp://www.tolerase.com/posts/view/4 > the layout doesn't render because all of the file paths aren't > resolving correctly. > > What could I be doing wrong? > > On Oct 9, 2:38 pm, "Wayne Fay" <[EMAIL PROTECTED]> wrote: > > > In Cake, they all go in your default layout: > > masthead + primary navigation + footer => > > cake\views\layouts\default.ctp (or .thtml) > > > Just add <?php echo $content_for_layout ?> in the middle where you > > want your content to appear. > > > Wayne > > > On 10/9/07, brianfidler <[EMAIL PROTECTED]> wrote: > > > > I'm brand new to Cake and struggling a little with the best way to > > > structure my files. Prior to cake I typically had an 'includes' > > > directory and a 'templates' directory. In the 'includes' directory I'd > > > usually put all of my database query code and logic files. In my > > > 'templates' directory I'd usually put template files that would then > > > include the appropriate file from the 'includes' directory. > > > > I understand the logic of MVC but am just at that critical point where > > > I'm trying to understand how to do in Cake, what I used to do in a > > > more standard PHP way. > > > > Any help would be great, here are some specifics that I need help > > > with... > > > > A typical site I work on will have the following blocks of > > > information: > > > > 1) masthead > > > 2) primary navigation > > > 3) content > > > 4) footer > > > > In CakePHP would each of these be separate views? Would the masthead > > > and footer go into a layout so that they can get reused? Would the > > > primary navigation, if it's generated from the database, be a view > > > with a model and controller? > > > > Just looking for some direction. thanks. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
