RE: cake:nocache and uncached views

2009-02-16 Thread Keith Norris Gmail

I think Alfredo probably meant wrap just the nocache tags, like this:

 
 
  check('Message.flash')) $session->flash(); ?>


 

- Keith 




--~--~-~--~~~---~--~~
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: cake:nocache and uncached views

2009-02-15 Thread Alfredo Quiroga-Villamil

Awesome, I am glad you figured it out.

Regards,

Alfredo

On Sun, Feb 15, 2009 at 9:38 PM, brian  wrote:
>
> Oh, of course! Sorry, a little slow this evening. That works like a
> charm. I think this tip should be included in the cookbook section
> about caching.
>
> But I'd actually just fixed it another way. It turned out that FF is
> ignoring the tags. The problem was that I have this bit of javascript
> that runs on page load:
>
>  $('#flash_msg').hide().center({top: 10})
>.animate({opacity: 'show'}, 'normal', function()
>{
>$(this).fadeOut(6000);
>})
>.find('a').click(function(ev)
>{
>$('#flash_msg').hide();
>ev.preventDefault();
>});
>
> The center() function includes these lines:
>
> if (positionType == 'static') {
>$self.parent().css("position","relative");
> }
>
> So, the cake tag was getting the position style attached. But, it
> wasn't that FF was paying any attention to that, but that the #content
> div was missing the style. So, #flash_msg was being positioned
> incorrectly.
>
> I fixed it by adjusting that first line with:
>
>  $('#flash_msg').hide().appendTo('#content').center({top: 10})
>
> So, your idea is definitely something that people should know about to
> keep those tags from interfering with a page's DOM scripting.
>
> On Sun, Feb 15, 2009 at 9:04 PM, Alfredo Quiroga-Villamil
>  wrote:
>>
>> I meant something like this.
>>
>> 
>>   
>>   check('Message.flash'))
>>$session->flash(); ?>
>>
>>
>> 
>>
>> I am trying to imagine how both FF and cake would be parsing the
>> content of the view to determine what to do. I am thinking FF will
>> likely ignore your cake:nocache tags and cake might just read them,
>> not sure how it was implemented; but perhaps they are just looking for
>> them and will skip anything in between giving you what you want.
>>
>> Regards,
>>
>> Alfredo
>>
>> On Sun, Feb 15, 2009 at 8:57 PM, brian  wrote:
>>>
>>> Then I would never see what's inside.
>>>
>>> On Sun, Feb 15, 2009 at 8:40 PM, Alfredo Quiroga-Villamil
>>>  wrote:
>>> > I wonder what will happen if you wrap the cake:nocache tags with a comment
>>> > 
>>> > Have you tried that?
>>> > Regards,
>>> > Alfredo
>>> >
>>> > On Sun, Feb 15, 2009 at 8:35 PM, brian  wrote:
>>> >>
>>> >> I have the following in my main layout:
>>> >>
>>> >> 
>>> >>check('Message.flash'))
>>> >> $session->flash(); ?>
>>> >>
>>> >> 
>>> >>
>>> >> Because it's in the layout, views that I don't want cached won't have
>>> >> the cake tags stripped This is causing some styling issues, at least
>>> >> in FF. (why it doesn't just ignore the tag I don't know.) Is anyone
>>> >> else seeing this?
>>> >>
>>> >> I realise that those views for which this is happening won't have
>>> >> CacheHelper sifting through the markup to remove the tags, but does
>>> >> anyone have an idea for dealing with this?
>>> >>
>>> >>
>>> >
>>> >
>>> > >
>>> >
>>>
>>> >
>>
>> >
>>
>
> >
>

--~--~-~--~~~---~--~~
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: cake:nocache and uncached views

2009-02-15 Thread brian

Oh, of course! Sorry, a little slow this evening. That works like a
charm. I think this tip should be included in the cookbook section
about caching.

But I'd actually just fixed it another way. It turned out that FF is
ignoring the tags. The problem was that I have this bit of javascript
that runs on page load:

 $('#flash_msg').hide().center({top: 10})
.animate({opacity: 'show'}, 'normal', function()
{
$(this).fadeOut(6000);
})
.find('a').click(function(ev)
{
$('#flash_msg').hide();
ev.preventDefault();
});

The center() function includes these lines:

if (positionType == 'static') {
$self.parent().css("position","relative");
}

So, the cake tag was getting the position style attached. But, it
wasn't that FF was paying any attention to that, but that the #content
div was missing the style. So, #flash_msg was being positioned
incorrectly.

I fixed it by adjusting that first line with:

 $('#flash_msg').hide().appendTo('#content').center({top: 10})

So, your idea is definitely something that people should know about to
keep those tags from interfering with a page's DOM scripting.

On Sun, Feb 15, 2009 at 9:04 PM, Alfredo Quiroga-Villamil
 wrote:
>
> I meant something like this.
>
> 
>   
>   check('Message.flash'))
>$session->flash(); ?>
>
>
> 
>
> I am trying to imagine how both FF and cake would be parsing the
> content of the view to determine what to do. I am thinking FF will
> likely ignore your cake:nocache tags and cake might just read them,
> not sure how it was implemented; but perhaps they are just looking for
> them and will skip anything in between giving you what you want.
>
> Regards,
>
> Alfredo
>
> On Sun, Feb 15, 2009 at 8:57 PM, brian  wrote:
>>
>> Then I would never see what's inside.
>>
>> On Sun, Feb 15, 2009 at 8:40 PM, Alfredo Quiroga-Villamil
>>  wrote:
>> > I wonder what will happen if you wrap the cake:nocache tags with a comment
>> > 
>> > Have you tried that?
>> > Regards,
>> > Alfredo
>> >
>> > On Sun, Feb 15, 2009 at 8:35 PM, brian  wrote:
>> >>
>> >> I have the following in my main layout:
>> >>
>> >> 
>> >>check('Message.flash'))
>> >> $session->flash(); ?>
>> >>
>> >> 
>> >>
>> >> Because it's in the layout, views that I don't want cached won't have
>> >> the cake tags stripped This is causing some styling issues, at least
>> >> in FF. (why it doesn't just ignore the tag I don't know.) Is anyone
>> >> else seeing this?
>> >>
>> >> I realise that those views for which this is happening won't have
>> >> CacheHelper sifting through the markup to remove the tags, but does
>> >> anyone have an idea for dealing with this?
>> >>
>> >>
>> >
>> >
>> > >
>> >
>>
>> >
>
> >
>

--~--~-~--~~~---~--~~
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: cake:nocache and uncached views

2009-02-15 Thread Alfredo Quiroga-Villamil

I meant something like this.


   
   check('Message.flash'))
$session->flash(); ?>




I am trying to imagine how both FF and cake would be parsing the
content of the view to determine what to do. I am thinking FF will
likely ignore your cake:nocache tags and cake might just read them,
not sure how it was implemented; but perhaps they are just looking for
them and will skip anything in between giving you what you want.

Regards,

Alfredo

On Sun, Feb 15, 2009 at 8:57 PM, brian  wrote:
>
> Then I would never see what's inside.
>
> On Sun, Feb 15, 2009 at 8:40 PM, Alfredo Quiroga-Villamil
>  wrote:
> > I wonder what will happen if you wrap the cake:nocache tags with a comment
> > 
> > Have you tried that?
> > Regards,
> > Alfredo
> >
> > On Sun, Feb 15, 2009 at 8:35 PM, brian  wrote:
> >>
> >> I have the following in my main layout:
> >>
> >> 
> >>check('Message.flash'))
> >> $session->flash(); ?>
> >>
> >> 
> >>
> >> Because it's in the layout, views that I don't want cached won't have
> >> the cake tags stripped This is causing some styling issues, at least
> >> in FF. (why it doesn't just ignore the tag I don't know.) Is anyone
> >> else seeing this?
> >>
> >> I realise that those views for which this is happening won't have
> >> CacheHelper sifting through the markup to remove the tags, but does
> >> anyone have an idea for dealing with this?
> >>
> >>
> >
> >
> > >
> >
>
> >

--~--~-~--~~~---~--~~
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: cake:nocache and uncached views

2009-02-15 Thread brian

Then I would never see what's inside.

On Sun, Feb 15, 2009 at 8:40 PM, Alfredo Quiroga-Villamil
 wrote:
> I wonder what will happen if you wrap the cake:nocache tags with a comment
> 
> Have you tried that?
> Regards,
> Alfredo
>
> On Sun, Feb 15, 2009 at 8:35 PM, brian  wrote:
>>
>> I have the following in my main layout:
>>
>> 
>>check('Message.flash'))
>> $session->flash(); ?>
>>
>> 
>>
>> Because it's in the layout, views that I don't want cached won't have
>> the cake tags stripped This is causing some styling issues, at least
>> in FF. (why it doesn't just ignore the tag I don't know.) Is anyone
>> else seeing this?
>>
>> I realise that those views for which this is happening won't have
>> CacheHelper sifting through the markup to remove the tags, but does
>> anyone have an idea for dealing with this?
>>
>>
>
>
> >
>

--~--~-~--~~~---~--~~
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: cake:nocache and uncached views

2009-02-15 Thread Alfredo Quiroga-Villamil
I wonder what will happen if you wrap the cake:nocache tags with a comment


Have you tried that?

Regards,

Alfredo

On Sun, Feb 15, 2009 at 8:35 PM, brian  wrote:

>
> I have the following in my main layout:
>
> 
>check('Message.flash'))
> $session->flash(); ?>
>
> 
>
> Because it's in the layout, views that I don't want cached won't have
> the cake tags stripped This is causing some styling issues, at least
> in FF. (why it doesn't just ignore the tag I don't know.) Is anyone
> else seeing this?
>
> I realise that those views for which this is happening won't have
> CacheHelper sifting through the markup to remove the tags, but does
> anyone have an idea for dealing with this?
>
> >
>

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