Re: A basic layout question

2006-08-25 Thread KN

Thanks AD.

I have gone through RequestHandler and I changed the code according to
that.
And it is working fine..
And I removed my ajax.thtml , it is not at all required.


AD7six wrote:
> add the RequestHandler component to your app controller and amongst
> other things it will ensure that you get a layout for normal calls, and
> not for ajax calls (i.e. what you want).
>
> It´s then not necessary to explicity call/refer to the ajax layout at
> all.
> 
> Cheers,
> 
> AD7six


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



Re: A basic layout question

2006-08-25 Thread AD7six

add the RequestHandler component to your app controller and amongst
other things it will ensure that you get a layout for normal calls, and
not for ajax calls (i.e. what you want).

It´s then not necessary to explicity call/refer to the ajax layout at
all.

Cheers,

AD7six


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



Re: A basic layout question

2006-08-24 Thread KN

Ok.. I have created a new layout - default.thtml

http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd";>


charset('UTF-8');?>
My Site title
css('mysite','stylesheet',array('media'=>'screen'));?>
link('prototype.js'); ?>
link('scriptaculous.js?load=builder,effects,dragdrop,controls,slider');?>
link('scrolltable.js'); ?>



 



link('nemomenu.js'); ?>



Note I have the render the element header in the layout.

And my ajax.thtml looks like 

On click of any link (menu), I am loading the new page with
render('newpage', 'ajax')

Now the problem is the header is repeating when I click on the links.

How can I solve this ?


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



Re: A basic layout question

2006-08-24 Thread Pablo Viojo
You're right. You should an default.thtml used to load all the pages in a non-AJAX way (this pages contains all the scripts) and ajax.thtml for the AJAX communication.Usually the AJAX transfers are simply data so it's improbably that you need some other scripts to work with it.
Regards,-- Pablo Viojo[EMAIL PROTECTED]http://pviojo.net
On 8/24/06, KN <[EMAIL PROTECTED]> wrote:
Thanks for the replies.Pablo , Do you  mean to say that my ajax.thtml should contain only  ? Then where I will include all_javascript_ files ?Should I need to create 
default.thtml (layout) ? And while clicking onany link ,I will load through ajax  . ie render('newpage' , 'ajax') .. Am Icorrect ?

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


Re: A basic layout question

2006-08-24 Thread KN


Thanks for the replies.

Pablo , Do you  mean to say that my ajax.thtml should contain only
  ? Then where I will include all
javascript files ?
Should I need to create default.thtml (layout) ? And while clicking on
any link ,
I will load through ajax  . ie render('newpage' , 'ajax') .. Am I
correct ?


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



Re: A basic layout question

2006-08-23 Thread Pablo Viojo
Download the firebug extension to firefox, so you can see the trasfers.Your ajax layout should not contain any doctype definitio, nor html, head, body tags, because what you're sending isn't a new document but a fragment of html (in general you're sending some data to process)
You can't load any _javascript_ (at least the way you're trying to do it) and you don't need to do it at all. As long as you haven't load a new page all your scripts previously loades are already loaded and you can use it.
If you need to load some scripts specifically for the fragment you're loading there are some methods, but it's a little difficult.Hope it helps youRegards,-- Pablo Viojo
[EMAIL PROTECTED]http://pviojo.netOn 8/23/06, Toby Parent <
[EMAIL PROTECTED]> wrote:Suggestions of how to see what's wrong with generated HTML: Look at it
through Firefox, with the Web Developer extension loaded in. Itincludes a toolbar option to 'View Generated Source'.Don't know if it'll help, but I use it often.Regards, - Toby (bigClown) Parent

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


Re: A basic layout question

2006-08-23 Thread Toby Parent

Suggestions of how to see what's wrong with generated HTML: Look at it
through Firefox, with the Web Developer extension loaded in. It
includes a toolbar option to 'View Generated Source'.

Don't know if it'll help, but I use it often.

Regards,
 - Toby (bigClown) Parent


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



A basic layout question

2006-08-23 Thread KN

Hi,

In my site I want all things should be done through ajax. So I have
created ajax.thtml and kept that file in layouts folder. And in
app_controller I have changed the layout to ajax.

Now the problem is after clicking on any link , will load the
respective page without refreshing the things.And that is working fine.
But the javascript files which I have included in ajax.thtml are not
loading to new page. I can not see source since it is loading through
ajax.

After searching a lot I found that ajax file should be blank..
My ajax layout (ajax.thtml) is

http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd";>


charset('UTF-8');?>
My Site title
css('mysite','stylesheet',array('media'=>'screen'));?>
link('prototype.js'); ?>
link('scriptaculous.js?load=builder,effects,dragdrop,controls,slider');?>
link('scrolltable.js'); ?>


 


link('nemomenu.js'); ?>



Any problem with this. I have not created default.php.

 Am I wrong on this ? Please guide me..


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