We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 12410
    • 353 Posts
    Hi Guys,
    I would like to be able to use as few templates as possible so would like to know the best way of using the IF extra.
    If I have a url www.mysite.com/animals/dogs

    animals = url segment 1 => parent id 2
    dogs = url segment 2 => child id 4

    Id like to be able to go

    if segment1 = animal
    ..some html/chunk/snippet whatever
    close if


    or


    if parent id = 2
    ..some html/chunk/snippet whatever
    close if

    Does anyone know the syntax that would work with the above. I know ExpressionEngine uses segments very well so hopefully Modx Revo would have some way of doing it.

    There may be some other workaround. Would love to hear suggestions.

    Thanks Guys!



    ##############IF info############
    http://docs.modxcms.com/display/ADDON/If

    [[!If?
    &subject=`[[+name]]`
    &operator=`EQ`
    &operand=`George`
    &then=`Hey George! Long time no see!`
    &else=`You’re not George. Go away.`
    ]]
      • 12410
      • 353 Posts