Timeline for Using a module tag as parameter adds +1 query per loop
Current License: CC BY-SA 3.0
6 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Apr 22, 2013 at 11:24 | comment | added | Ian Young | Actually, it's probably because you're calling your plugin within the Channel Entries loop so for each iteration it will make the same queries. Can you not Stash your Channel Entries loop too and then call the results of that into your plugin call? | |
Apr 22, 2013 at 8:58 | comment | added | Dylan | I probably posted a bad example. I didn't show my template using stash as I thought it would complicate things when stash isn't the cause of the problem. I'll post a stripped down example. | |
Apr 22, 2013 at 8:19 | history | edited | Ian Young | CC BY-SA 3.0 |
Fixed typo
|
Apr 22, 2013 at 8:18 | comment | added | Ian Young | OK, I think I understand. To be honest the first query where the module is being selected from the modules table sounds like normal behaviour and I'm not sure you can cut remove that at all. Certainly from what I see of the loop in the templates though that can be optimised quite a lot. I can't see how you're using Stash in combination with that nested loop as you haven't included it but a 'template partials' approach is mainly for the benefit of a more efficient way of templating more akin to the Ruby methodology or modern PHP template languages. | |
Apr 22, 2013 at 8:05 | comment | added | Dylan | Thanks Ian but that's not the problem. I'm using stash and already have all my other queries optimised which is why I've noticed that I'm getting these extra queries for the module name. I'm trying to establish if I can avoid that particular query. Sorry if my question wasn't clear. | |
Apr 22, 2013 at 7:58 | history | answered | Ian Young | CC BY-SA 3.0 |