We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 33968
    • 863 Posts
    @dun: ’Switch’ is so basic it will run on Evo - not tested but don’t see why it wouldn’t work!

    Just create a new snippet named ’switch’ and paste in the following:
    <?php
    /*
      * Switch
      *
      * Created by Uroš Likar
      * [email protected]
      * http://uros.likar.si
      *
      */
      
      if(empty($default)) $default = '';  
      $i = 1;  
      while(isset(${'c'.$i})){
        $case[$i] = trim(${'c'.$i});
        $do[$i] = trim(${'do'.$i});
        $i++;  
      }
      
      $key = array_search(trim($get),$case); 
      if(!empty($key)) $output = $do[$key]; else $output = $default;
        
      return $output;
    


    Install UltimateParent and then try what I suggested. You’ll need to use Evo syntax and keep it all on one line:
    [[switch? &get=`[[UltimateParent]]` &c1=`1` &do1=`{{chunk1}}` &c2=`2` &do2=`{{chunk2}}` &default=`{{chunk4}}`]]
    
      • 18373 ☆ A M B ☆
      • 3,141 Posts
      In Evolution you’ll probably need to combine cached & uncached syntax for UltimateParent to work with that method..

      [!switch? &get=`[[UltimateParent]]` &c1=`1` &do1=`{{chunk1}}` &c2=`2` &do2=`{{chunk2}}` &default=`{{chunk4}}`!]
        Mark Hamstra • Developer spending his days working on Premium Extras and a MODX Site Dashboard with the ability to remotely upgrade MODX and extras to make the MODX world a little better.

        Tweet me @mark_hamstra, check my infrequent blog at markhamstra.com, my slightly more frequent ramblings at MODX.today or see code at Github.
        • 33968
        • 863 Posts
        ^ What he said... forgot about that smiley
          • 8214
          • 28 Posts
          Thanks Lucas and Mark, I will work on it.

          And now to get the heck out of Sean’s thread in case he needs to keep going... tongue
            • 26503
            • 620 Posts
            Quote from: dun at May 01, 2011, 10:33 PM

            Thanks Lucas and Mark, I will work on it.

            And now to get the heck out of Sean’s thread in case he needs to keep going... tongue

            haha - no problem, I just got back to this tonight... used Lucas’ solution, got it setup for 5 call-outs over 5 different slots in less than 1/2 hour... works perfectly..the onl;y drawback being that if you add another call-out you need to update all your TV’s - but we were expecting that anyway. The other nice thing about this is that you can "limit" which call-outs go in which slots good to keep clients from buggering the integrity of our designs smiley

            nice - every time I go to do something with Modx I’m always surprised at how fast & easy it really is.

            Now I’m off to figure out how to hide a chunk from a specific user group..... smiley

            -thanks guys
            -sean
              *** Not just websites, we also create signage, banners, print, trade show displays and more! ***

              Sean Kimball CLP, CLS.
              Technical Director / Sr. Developer | BigBlock Studios
              ._______________________________________________.
              Bigblock Studios http://www.bigblockstudios.ca Web site design & development.
              27-1300 King Street East. Box 167 Oshawa, Ontario L1H8J4 Canada.
              phone/fax: 905-426-5525
              • 33968
              • 863 Posts
              Quote from: sean69 at May 03, 2011, 09:25 PM

              if you add another call-out you need to update all your TV’s
              You’re gonna love this...

              Copy your callout options (the pipe delimited list) into a chunk instead. Then in your TV under input option values:
              @CHUNK chunkName

              Where ’chunkName’ is the name of the chunk holding your callouts list.

              Then you only need to update the one chunk if you want to add or remove something from the list cool
                • 26503
                • 620 Posts
                Quote from: lucas at May 04, 2011, 02:21 AM

                Quote from: sean69 at May 03, 2011, 09:25 PM

                if you add another call-out you need to update all your TV’s
                You’re gonna love this...

                Copy your callout options (the pipe delimited list) into a chunk instead. Then in your TV under input option values:
                @CHUNK chunkName

                Where ’chunkName’ is the name of the chunk holding your callouts list.

                Then you only need to update the one chunk if you want to add or remove something from the list cool

                Lucas, I’ve always said that if I ever run into a Drupal developer they would know the meaning of wrath, after seeing that little chunk, I can only feel pity for them....

                -sean
                  *** Not just websites, we also create signage, banners, print, trade show displays and more! ***

                  Sean Kimball CLP, CLS.
                  Technical Director / Sr. Developer | BigBlock Studios
                  ._______________________________________________.
                  Bigblock Studios http://www.bigblockstudios.ca Web site design & development.
                  27-1300 King Street East. Box 167 Oshawa, Ontario L1H8J4 Canada.
                  phone/fax: 905-426-5525