Friday 08 December 2006 1:33:20 am
Hi everyone, I've gone through every post related to caching and I still can't solve a problem I'm having in 3.6.10. I'm trying to show a block of text and an image as a copyright on certain pages. Whether to show it or not is decided by a check box in the classes which can have the copyright. It is only allowed to be shown in certain sections of the site (microsites under the main site). These sections have their own pagelayout template as an override. At the foot of this I had something like this:
{section show=$node.data_map.show_copyright.content}
Divs, images, text goes here
{/section}
This showed the image when the box was checked. But if you went to the page a second time, it disappeared. The node wasn't know the second time around. After a lot of forum searching and trial and error (the ttl 0 line at the top didn't fix it), I found that this stopped that problem:
{cache-block keys=array('copyright', $uri_string, $current_user.is_logged_in)}
{section show=$node.data_map.show_copyright.content}
Divs, images, text goes here
{/section}
{/cache-block}
Even though this had nothing to do with users being logged in it worked, both when users were logged in and not. I thought I had finally fixed it. But the next morning, the copyright was gone. More testing showed that it disappeared after the 2 hour cache default. Can anyone help point out what I need to do/where I've gone wrong?
Regards Jon Staines
|