We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

EE2 - Find if something is IN something else

How Do I?

Kubik101's avatar
Kubik101
155 posts
9 years ago
Kubik101's avatar Kubik101

Hi Guys.

I am wondering if you can find if something is IN something else with standard EE conditionals.

For example:

{if 'kubik' IN '{custom_field}'}blah{if:else}foo{/if}

I don’t want it to be equal to the whole thing I just want to find if that part is in it.

Hope that makes sense. Not the best at explaining sometimes.

Thanks. =)

p.s. I am using EE2.8.1

       
Pedro Guimaraes's avatar
Pedro Guimaraes
170 posts
9 years ago
Pedro Guimaraes's avatar Pedro Guimaraes
Hi Guys. I am wondering if you can find if something is IN something else with standard EE conditionals. For example:
{if 'kubik' IN '{custom_field}'}blah{if:else}foo{/if}
I don’t want it to be equal to the whole thing I just want to find if that part is in it.

Yes you can! Though you’ll need to upgrade to at least EE 2.9. Try something like this:

{if custom_field *= "kubik"}Upgrade to EE 2.10.x{if:else}Lose out{/if}

Here’s the EllisLab post about the new conditionals: New Conditionals Parser in 2.9

       
Kubik101's avatar
Kubik101
155 posts
9 years ago
Kubik101's avatar Kubik101

Nicely put Pedro, made me smile. Thanks for the hot tip. =)

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.