What’s the difference between using a search: parameter to limit my results:
search:region="canada"..and using a conditional instead?:
{if region == 'canada'}This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.
The active forums are here.
November 18, 2010 11:34am
Subscribe [3]#1 / Nov 18, 2010 11:34am
What’s the difference between using a search: parameter to limit my results:
search:region="canada"..and using a conditional instead?:
{if region == 'canada'}#2 / Nov 18, 2010 12:43pm
Consider this:
{exp:weblog:entries weblog="foo" limit="10" search:region="canada" ...}vs.
{exp:weblog:entries weblog="foo" limit="10"}
{if region == 'canada'} ... {/if}
{/exp:weblog:entries}In the first case you’re getting 10 entries where region=canada, in the latter 10 entries, throwing away the ones that don’t match.
#3 / Nov 18, 2010 12:48pm
I see. So if I don’t have a limit set, there’s no difference?
#4 / Nov 18, 2010 12:54pm
Actually, there are. If it’s part of the initial tag EE will modify the query and only pull appropriate entries. Otherwise all entries are pulled, with the conditional determining which ones to show resulting in a heavier load than strictly necessary.
#5 / Nov 18, 2010 1:00pm
Okay, that’s what I figured.
Thanks Ingmar.
#6 / Nov 19, 2010 2:50am
Glad Ingmar was able to help. Feel free to start a new thread if you have any more questions.