Announcement

Collapse
No announcement yet.

Syntax to Include a Category Prefix and Exclude a Category Suffix

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Syntax to Include a Category Prefix and Exclude a Category Suffix

    Hello,

    I need to be able to exclude a category suffix in the code below. I am using the following code to include any category that has the prefix "GCD_" and want it to exclude the two categories with the suffix "_BBG" and "_CAG".

    <mvt:if expr="'GCD_' CIN l.settings:category:code">
    do this
    </mvt:if>

    Is there an easy way to do this instead of having a line that would basically include 40+ categories? I am concerned with the line getting too long and slowing things down.

    Thanks in advance,
    Mike

    #2
    Re: Syntax to Include a Category Prefix and Exclude a Category Suffix

    Try:

    Code:
    <mvt:if expr="'GCD_' CIN l.settings:category:code">
    <mvt:if expr="NOT ('_BBG,_CAG' CIN l.settings:category:code)">
    do this
    </mvt:if>
    </mvt:if>

    Comment


      #3
      Re: Syntax to Include a Category Prefix and Exclude a Category Suffix

      I don't think that second expression will work because its going to look for "_BBG,_CAG" in the l.settings category code. You would have to write it out as AND NOT( '_BBG' CIN l.settings:category:code) AND NOT( '_CAG' CIN l.settings:category:code).

      You can also just add this to the first expression.
      Bruce Golub
      Phosphor Media - "Your Success is our Business"

      Improve Your Customer Service | Get MORE Customers | Edit CSS/Javascript/HTML Easily | Make Your Site Faster | Get Indexed by Google | Free Modules | Follow Us on Facebook
      phosphormedia.com

      Comment


        #4
        Re: Syntax to Include a Category Prefix and Exclude a Category Suffix

        Thanks, this one did the trick!

        <mvt:if expr="'GCD_' CIN l.settings:category:code">
        <mvt:if expr="NOT ('_BBG,_CAG' CIN l.settings:category:code)">
        do this
        </mvt:if>
        </mvt:if>

        Comment


          #5
          Re: Syntax to Include a Category Prefix and Exclude a Category Suffix

          Glad to help.

          Comment

          Working...
          X