Search code examples
expressionengine

Expression Engine - Channel Fields Search


I'm fairly new to Expression Engine and I feel this is a really simple question, I just can't find a straight-forward answer from the documentation.

I have a list of restaurants and an alphabetized menu (A B C D etc...)

I want to search only he listings that start with the letter "A".

In a tradiational MySQL search that's be WHERE Title LIKE 'A%'

Any ideas?


Solution

  • Expression Engine doesn't have an exact "LIKE" option but they do have something similar.

    I can search a field to see if it "contains" a string but there isn't anything specifically to determine if it starts with or ends with a specific string (such as would be easily available in MySQL).

    I ended up doing the "contains" search parameter and then excluded any results within the exp:channel:entries looping that didn't match my exact criteria.