We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 14999
    • 0 Posts
    Should I make this simple snippet without calling any chunks that will handle youtube videos in my case,


    the page by placing the call to the snippet, it looks like this



    [[Snippet? if member A output ="htmlcode1" if member B output ="htmlcode2" else output member not registered output="htmlcode3"}]]


    Many thanks to those who bring forward the discussion
      • 16702 ☆ A M B ☆
      • 536 Posts
      Last Of The Romans Reply #2, 15 years, 1 month ago
      FOR REVO

      Quote from: juke80 at Aug 05, 2011, 05:26 AM

      Should I make this simple snippet without calling any chunks that will handle youtube videos in my case,
      the page by placing the call to the snippet, it looks like this
      [[Snippet? if member A output ="htmlcode1" if member B output ="htmlcode2" else output member not registered output="htmlcode3"}]]
      Many thanks to those who bring forward the discussion


      http://modx.com/extras/package/switch

      Parameters

      &get = input parameter

      &c1, &c2, &c3 .... case 1, case 2, case 3,....

      &do1, &do2, &do3 = output parameter for matching case

      you can use unlimited input parameters c1 c2 c3 ... each c# must have output d#

      &default (optional) = default value if no matching case found

      Usage:

      [[!switch? &get=`3` &c1=`1` &do1=`one` &c2=`2` &do2=`two` &c3=`3` &do3=`three` &c4=`4` &do4=`four` &default=`default value` ]]

      raturns: three

      [[!switch?
      &get=`xxx`
      &c1=`1` &do1=`one`
      &c2=`2` &do2=`two`
      &c3=`3` &do3=`three`
      &c4=`4` &do4=`four`
      &default=`default value`
      ]]

      raturns: default value

        palma non sine pulvere
        • 28042 ☆ A M B ☆
        • 24,524 Posts
        That’s a Revo extra. What version of MODx are you using?
          Studying MODX in the desert - http://sottwell.com
          Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
          Join the Slack Community - http://modx.org
          • 14999
          • 0 Posts
          Thank’s

          I use modx evo 1.0