MODX getPage caches non cacheable snippets in 1st resource, how to fix the bug

278 Views Asked by At

I have a strange problem. I use getPage to view some similar resources. They have one template and same resource options. The problem is that getPage trying to cache my non-cacheable snippets in the 1st element. If u see next code, u can notice the difference.

 'output' => '<div class="thumbnail">20:21:54 </div> ... <div class="thumbnail">[[!showDate:gt=`0`:show]]</div> ... <div class="thumbnail">[[!showDate:gt=`0`:show]]</div>'

Heres link on "full" version http://pastie.org/7372941

As u can see, only first elements renders even if i didnt want it, pls help me to fix, i was trying ... but theres too much code 4 me in the core.

1

There are 1 best solutions below

2
On

Столкнулся с той же самой проблемой... Пришлось извращаться :(

Создал dummy ресурс, который прописал в критериях выборки через &resources=`dummy-id` и установил его свойства таким образом, чтобы он выводился всегда первым. В моем случае поставил дату publishedon на 20 лет вперед. Потом для getResources прописал &tplFirst=`@INLINE <div></div>`, чтобы этот ресурс не отображался. Ну и напоследок выставил для getPage количество отображаемых ресурсов на первой странице на 1 больше через параметр &pageOneLimit=`[[+page_size:incr]]`


A not very good translation by Google

Faced with the same problem ... Had subverted: (

I created a dummy resource that prescribed in the criteria for selection through & resources = `dummy-id` and set its properties so that it is always displayed first. In my case, set the date publishedon the next 20 years. Then for getResources prescribed & tplFirst = `@ INLINE <div> </ div>`, that this resource is not displayed. And finally set to getPage the number of displayed resources on the front page for one more in a parameter & pageOneLimit = `[[+ page_size: incr]]`