ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Some help with conditional variables

March 01, 2013 9:34am

Subscribe [2]
  • #1 / Mar 01, 2013 9:34am

    WeeRab

    3 posts

    I use the geofinder add-on, that works with a radius that’s read from the URL (radius is stored in segment_4).

    I would like to try to set a max, if people are trying to add an outrageous radius directly in the URL. So I would like to create a maximum.

    {if segment_4 >= 51} radius="50" {if:else} radius="{segment_4}" {/if}


    Is this the right syntax? Because I can’t get it to work…..or at least, there’s not a maximum set with this code.

    Thanks!!!

    Cheers, Robbert

  • #2 / Mar 01, 2013 2:17pm

    Rob Allen

    3114 posts

    This worked for me

    {if segment_4 >= "50"}
    50
    {if:else}
    radius="{segment_4}"
    {/if}
.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases