[Neos] Cache entryIdentifier with request arguments

Visay Keo visay.keo at typo3.org
Mon Mar 23 07:45:16 CET 2015


Hi,

I have an object that read the request argument to build a list of 
product and I cannot configure out the cache to work properly. Here is 
my TS code:

prototype(My.Package:ProductList) {
	templatePath = 
'resource://My.Package/Private/Templates/NodeTypes/Product/ProductList.html'

	productCategory = ${request.arguments.productCategory ? 
q(site).find('[instanceof 
My.Package:Product]').find('main').children(request.arguments.productCategory).get(0) 
: q(node).property('defaultProductCategory')}

	products = ${this.productCategory ? q(site).find('[instanceof 
My.Package:Product]').get() : []}
	products. at process.filterByReference = ${this.productCategory ? 
q(value).filterByReference('category', this.productCategory).get() : 
q(value)}

	@cache {
		mode = 'cached'
		entryIdentifier.productCategory = ${request.arguments.productCategory}
		entryTags {
			1 = ${'NodeType_' + 'My.Package:ProductCategory'}
		}
	}
}

The product list is rendered correctly but when I switch to another 
category, it just shows the same one until I manually clear the cache.

Anyone knows what am I missing here?

Thanks,
Visay

-- 
TYPO3 .... Inspiring People To Share!
Participate: http://typo3.org/participate/


More information about the Neos mailing list