3212 Posts in 847 Topics by 809 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 210 Views |
-
Partial Caching - How do you make a cache for different children

13 March 2012 at 12:27am
Hey there!
I need some help in using the partial caching feature. When I put a cache on the main <% control Children %>, it shows the same page for all of the other children.
For example, I have a /products/bangles/ section on the website rendered by a ProductsCategory.ss template. When I access /products/earrings/, the products for bangles show up as well. That goes true for all the other siblings of the categories.
My main question is, is there a way to enable partial caching for all of the children of products and cache them all separately?
Thanks in advance for your help!
-
Re: Partial Caching - How do you make a cache for different children

13 March 2012 at 1:11am Last edited: 13 March 2012 1:14am
Of course.
You have to give them different cache keysfor example:
<% control Products %>
<% cached %>
$ProductName
<% end_cached %>
<% end_control %>wont work, try the following:
<% control Products %>
<% cached 'Product', ID %>
$ProductName
<% end_cached %>
<% end_control %> -
Re: Partial Caching - How do you make a cache for different children

13 March 2012 at 1:40am
Hi dpde!
Thank you so so very much for your prompt response. It worked brilliantly!
I really appreciate the help that you have given me.
Till next time!
-
Re: Partial Caching - How do you make a cache for different children

13 March 2012 at 1:53am
You are welcome. ;)
More information about partial caching can be found here:
http://doc.silverstripe.org/sapphire/en/reference/partial-caching
| 210 Views | ||
|
Page:
1
|
Go to Top |


