This site has been archived and you can no longer log in or post new messages. For up-to-date community resources please visit ezplatform.com

eZ Community » Forums » Developer » ViewCaching and $view_parameters
expandshrink

ViewCaching and $view_parameters

ViewCaching and $view_parameters

Friday 24 June 2011 11:03:15 am - 2 replies

I've created a custom layout for handling AJAX requests which fetches content based on passed view parameters, but when ViewCaching is enabled the $view_parameters array only contains content the first time the layout is shown.

I call the address example.com/layout/set/ajax/(node_id)/155 and use the attribute operator to print out the contents of the $view_parameters array to test it, and it's clearly empty after the first time. I tried using a cache-block with the $view_parameters area as keys, but that doesn't help since the array becomes empty and using a static value for keys would mean that it will show the same content no matter what view parameters are sent to it.

I also tried to set the cache_ttl variable to 0, but to no avail.

Friday 24 June 2011 12:45:27 pm

Discovered what was wrong, thanks to a coworker of mine:

Apparently, the layout module gives you access to the GET parameters, but not the view parameters, which is the exact opposite of what the content module does. Great.

Saturday 25 June 2011 1:36:46 pm

You might want to try out the ezwebservicesapi extension: it gives you webservice access to all existing fetch functions...

expandshrink

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu

Proudly Developed with from