Also, if you want to be able to enable/disable one or another element,
have a look at this:

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

It's a bit old now so I expect you'd need to update it somewhat,
unless Jonathan has already done so.

On Thu, Apr 16, 2009 at 10:20 AM, jsundquist <jsundqu...@gmail.com> wrote:
>
> Brian is correct. You should use $this->element() to format how you
> want each column on your page to be displayed. So you could have a
> right, left, and center view in your elements folder then have a
> variable set in your function for the view for each column.  Each
> column then would could use the respected variable to display the data
> where you want it and how you want it formatted.
>
> On Apr 15, 6:58 pm, brian <bally.z...@gmail.com> wrote:
>> $content_for_layout is essentially everything in your view, after PHP
>> has parsed it. I think what you probably want is to use
>> $this->element().
>>
>> On Wed, Apr 15, 2009 at 7:24 PM, Dave Maharaj :: WidePixels.com
>>
>> <d...@widepixels.com> wrote:
>>
>> > So if I had <?php echo $content_for_layout; ?> in default.ctp and then in
>> > the actual ctp for action say posts/view I could inside the view.ctp have 2
>> > variables
>> > <?php echo $leftContent_for_layout; ?> and <?php echo
>> > $rightContent_for_layout; ?> for each side of the columns and define what
>> > would show up there by defining it in the controller view () action?
>>
>> > Thanks,
>>
>> > Dave
>>
>> > -----Original Message-----
>> > From: dr. Hannibal Lecter [mailto:lecter...@gmail.com]
>> > Sent: April-15-09 7:28 PM
>> > To: CakePHP
>> > Subject: Re: Layout Columns
>>
>> > Of course you can. $content_for_layout is nothing but a regular view
>> > variable, like the ones you set in your controller with $this->set().
>>
>> > On Apr 15, 10:43 pm, "Dave Maharaj :: WidePixels.com"
>> > <d...@widepixels.com> wrote:
>> >> Can you take 1 template (default.ctp) and define sections within it?
>>
>> >> I have a 2 col layout and would like to define what modules to load
>> >> depending on the page a user is on / if logged in / by group
>>
>> >> How can this be done if all i have is <?php echo $content_for_layout;
>> >> ?>
>>
>> >> Thinking of Joomla where you can set what modules for each page is the
>> > idea.
>> >> Is that possible?
>>
>> >> Dave
>>
>>
> >
>

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to