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,
    How do you use the If Extra or output filters with radio options. i thought this should work:
    [[!If?
       &subject=`[[*stype_radio]]`
       &operator=`EQ`
       &operand=`sales`
       &then=`do this`
    &else=`do that`]]


    I have it set like
    Rentals==rentals||Sales==sales
    and would like either one checked by default.
    Any ideas please?
    Thanks
      • 4172
      • 5,888 Posts
      please show us a bit more of your scenarario

      If your Tv is a radio-TV and you've checked Sales in the manager the If-snippet will output 'do this' in your example.

      Doesn't it?
        -------------------------------

        you can buy me a beer, if you like MIGX

        http://webcmsolutions.de/migx.html

        Thanks!
        • 12410
        • 353 Posts
        Hi Bruno,
        I'm trying to get this working:

        [[!If?
           &subject=`[[*stype_radio]]`
           &operator=`EQ`
           &operand=`sales`
           &then=`
        
        [[!AdvSearch? 
          &ids=`[[!GetIds? &ids=`c147`]]` 
          &tpl=`salesSearchResult`
         
          &perPage=`5` 
        &pagingType=`2`
          &queryHook=`sales-hook` 
          &withTVs=`property_type,bedrooms` 
          &includeTVs=`property_area,property_price,service_type,property_ref,property_p_image,bathrooms,sq_ft,stype_radio`
          &sortby=`bedrooms` 
        ]]
        
        `
        &else=`
        
        [[!AdvSearch? 
          &ids=`[[!GetIds? &ids=`c148`]]` 
          &tpl=`salesSearchResult`
         
          &perPage=`5` 
        &pagingType=`2`
          &queryHook=`sales-hook` 
          &withTVs=`property_type,bedrooms` 
          &includeTVs=`property_area,property_price,service_type,property_ref,property_p_image,bathrooms,sq_ft`
          &sortby=`bedrooms` 
        ]]
        
        
        `]]
        


        but the TV stype_radio just won't return the value "sales" to satisfy the conditional.
        my input options are
        Sales==sales||Rental==rental 

        Neither radio option is ticked either and I'd like either to be.

        Thanks
          • 1343 ☆ A M B ☆
          • 2,213 Posts
          Hello,

          Could you try doing something like:

          TV Values: Sales==1||Rental==2

          Change the If calls accordingly for 1/2 vs sales/rental
            Patrick | Server Wrangler
            About Me: Website | Tweets |  MODX Hosting