0

I am trying to use the wildcard for my {if} statement. Where I could have P12,P24,P36,48, etc.

{if segment_4 !="" && segment_4 !="P*"}

But The wildcard is not working for me, does the queries need to be turned on or something?

Thanks for the help in advance.

3

There are no wildcards in EE. You're probably looking for something like Switchee, where you can use regular expression matching, or Mo Variables, which gives you {if paginated}, which could help here.

1

You could also use Segment Search which is another free addon and allows more control of segment searching. This should work:

{exp:segment_search keyword="/P\d+/" segments="4" regex="yes"}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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