1

I am using search tag for express engine channel but it is not working.

for eg. I have created a channel named as 'XYZ' and having following channel fields there :

1) user_type : text

2) profile : grid a) first_name : text b) last_name : text c) user_name : text d) age : text

Now i want to show user listing for a entry which age is greater than 20 and less than 40. i have used following code :

{exp:channel:entries channel="xyz" entry_id=1}
    {profile search:age=">20" search:age="<40"}
        {profile:first_name}<br/>
        {profile:last_name}<br/>
        {profile:user_name}<br/>
        {profile:age}<hr>
    {/profile}
{/exp:channel:entries}

But the code above does not give correct result.

Please help me what is missing/wrong here or give me a solution for the same.

1 Answer 1

0

Unfortunately you cannot use more than one search parameter per field.

Less than ideal, but you could do a conditional in addition to your search. It will throw you off if you want to use the row_count and total_rows variables though.

{profile search:age=">20"}
    {if age < 40}
        {profile:first_name}<br/>
        {profile:last_name}<br/>
        {profile:user_name}<br/>
        {profile:age}<hr>
    {/if}
{/profile}
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.