Re: Using Javascript->link Inside An Element

2010-06-08 Thread calvin
I know, it sucks. I think I did manage to achieve a similar result in
a very roundabout way in one of my older applications, but it's not
really worth the hassle; Cake just isn't set up for it.

On Jun 8, 7:15 am, Dima  wrote:
> My original implementation did exactly what you describe but I was
> hoping that it could be done otherwise.  Guess not.
>
> Thanks,
> Dima
>
> On Jun 7, 8:12 pm, calvin  wrote:
>
> > You only use echo when you're linking them inline. So you would never
> > have something like:
>
> > echo $javascript->link($scriptname, false);
>
> > It would either be:
>
> > echo $javascript->link($scriptname);
>
> > or:
>
> > $javascript->link($scriptname, false);
>
> > Unfortunately, you can't use the $scripts_for_layout variable in the
> > layout or elements included from the layout because usually by that
> > point the variable has already been printed out.
>
> > Your best bet would be to just place inline link calls in the header
> > section of the layout.

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


Re: Using Javascript->link Inside An Element

2010-06-08 Thread Dima
My original implementation did exactly what you describe but I was
hoping that it could be done otherwise.  Guess not.

Thanks,
Dima

On Jun 7, 8:12 pm, calvin  wrote:
> You only use echo when you're linking them inline. So you would never
> have something like:
>
> echo $javascript->link($scriptname, false);
>
> It would either be:
>
> echo $javascript->link($scriptname);
>
> or:
>
> $javascript->link($scriptname, false);
>
> Unfortunately, you can't use the $scripts_for_layout variable in the
> layout or elements included from the layout because usually by that
> point the variable has already been printed out.
>
> Your best bet would be to just place inline link calls in the header
> section of the layout.

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


Re: Using Javascript->link Inside An Element

2010-06-07 Thread calvin
You only use echo when you're linking them inline. So you would never
have something like:

echo $javascript->link($scriptname, false);

It would either be:

echo $javascript->link($scriptname);

or:

$javascript->link($scriptname, false);

Unfortunately, you can't use the $scripts_for_layout variable in the
layout or elements included from the layout because usually by that
point the variable has already been printed out.

Your best bet would be to just place inline link calls in the header
section of the layout.

On Jun 7, 2:51 pm, Dima  wrote:
> vekija, thanks a ton for your help!!  I added echo in front of all 4
> of the lines in nav_menu.cpt.  I was immediately able to see the style
> sheets kick in; however, when I look at page source, it still doesn't
> show those files in the page header and is not displaying correctly.
> Am I using the  correctly?  Does it
> have to go before/after a certain point in the header?
>
> Thanks again,
> Dima
>
> On Jun 7, 4:10 pm, vekija  wrote:
>
> > you have to "echo" those :)
>
> > echo $javascript->link('mootools-for-dropdown', false);
>
> > On Jun 7, 8:43 pm, Dima  wrote:
>
> > > I'm pretty new to CakePHP so it is likely that my issue is rather
> > > simple to fix.  I have a custom element which I created called
> > > nav_menu.cpt.  I call this element from default.cpt using:
>
> > > element('nav_menu'); ?>
>
> > > For my element to work properly, I need to import 3x .js files and
> > > 1x .css file; I have placed these files in /webroot/js/ and /webroot/
> > > css/ respectively and am attempting to call them inside the element
> > > like so:
>
> > >  > > $javascript->link('mootools-for-dropdown', false);
> > > $javascript->link('UvumiDropdown-compressed', false);
> > > $javascript->link('nav_menu', false);
> > > $html->css('uvumi-dropdown');
> > > ?>
>
> > > However, when the page loads and I check page source, it doesn't
> > > include these files in the header.  I've also tried calling this
> > > following line in default.cpt with no success:
>
> > > 
>
> > > What am I doing wrong??
>
> > > Thanks,
> > > Dima

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


Re: Using Javascript->link Inside An Element

2010-06-07 Thread Dima
vekija, thanks a ton for your help!!  I added echo in front of all 4
of the lines in nav_menu.cpt.  I was immediately able to see the style
sheets kick in; however, when I look at page source, it still doesn't
show those files in the page header and is not displaying correctly.
Am I using the  correctly?  Does it
have to go before/after a certain point in the header?

Thanks again,
Dima

On Jun 7, 4:10 pm, vekija  wrote:
> you have to "echo" those :)
>
> echo $javascript->link('mootools-for-dropdown', false);
>
> On Jun 7, 8:43 pm, Dima  wrote:
>
> > I'm pretty new to CakePHP so it is likely that my issue is rather
> > simple to fix.  I have a custom element which I created called
> > nav_menu.cpt.  I call this element from default.cpt using:
>
> > element('nav_menu'); ?>
>
> > For my element to work properly, I need to import 3x .js files and
> > 1x .css file; I have placed these files in /webroot/js/ and /webroot/
> > css/ respectively and am attempting to call them inside the element
> > like so:
>
> >  >         $javascript->link('mootools-for-dropdown', false);
> >         $javascript->link('UvumiDropdown-compressed', false);
> >         $javascript->link('nav_menu', false);
> >         $html->css('uvumi-dropdown');
> > ?>
>
> > However, when the page loads and I check page source, it doesn't
> > include these files in the header.  I've also tried calling this
> > following line in default.cpt with no success:
>
> > 
>
> > What am I doing wrong??
>
> > Thanks,
> > Dima

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


Re: Using Javascript->link Inside An Element

2010-06-07 Thread vekija
you have to "echo" those :)

echo $javascript->link('mootools-for-dropdown', false);

On Jun 7, 8:43 pm, Dima  wrote:
> I'm pretty new to CakePHP so it is likely that my issue is rather
> simple to fix.  I have a custom element which I created called
> nav_menu.cpt.  I call this element from default.cpt using:
>
> element('nav_menu'); ?>
>
> For my element to work properly, I need to import 3x .js files and
> 1x .css file; I have placed these files in /webroot/js/ and /webroot/
> css/ respectively and am attempting to call them inside the element
> like so:
>
>          $javascript->link('mootools-for-dropdown', false);
>         $javascript->link('UvumiDropdown-compressed', false);
>         $javascript->link('nav_menu', false);
>         $html->css('uvumi-dropdown');
> ?>
>
> However, when the page loads and I check page source, it doesn't
> include these files in the header.  I've also tried calling this
> following line in default.cpt with no success:
>
> 
>
> What am I doing wrong??
>
> Thanks,
> Dima

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


Using Javascript->link Inside An Element

2010-06-07 Thread Dima
I'm pretty new to CakePHP so it is likely that my issue is rather
simple to fix.  I have a custom element which I created called
nav_menu.cpt.  I call this element from default.cpt using:

element('nav_menu'); ?>

For my element to work properly, I need to import 3x .js files and
1x .css file; I have placed these files in /webroot/js/ and /webroot/
css/ respectively and am attempting to call them inside the element
like so:

link('mootools-for-dropdown', false);
$javascript->link('UvumiDropdown-compressed', false);
$javascript->link('nav_menu', false);
$html->css('uvumi-dropdown');
?>

However, when the page loads and I check page source, it doesn't
include these files in the header.  I've also tried calling this
following line in default.cpt with no success:



What am I doing wrong??

Thanks,
Dima

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