We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
  • <?php
    $modx->getTemplateVarOutput('sideQuotes') == 'Show' ? $output = '{{sidebarQuote'}} : $output = '';
    
    return $output;
    


    Depending on what's in that sidebarQuote chunk, you could also directly output the chunk's content:
    <?php
    $modx->getTemplateVarOutput('sideQuotes') == 'Show' ? $output = $modx->getChunk('sidebarQuote') : $output = '';
    
    return $output;
    

      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
      • 36685
      • 5 Posts
      Thanks for the quick reply, Susan. That is what I was thinking for the PHP solution, but again, you have to write the conditionals out for each scenario this way. Not a huge deal, I understand, but PHX feels faster to develop with coming from a front-end developer stand-point. It feels more like using WordPress shortcodes or any other snippet once you understand the basic syntax. I don't have to go back and load a separate element/snippet each time I want to change the conditional terms in the template either.

      I see your argument for not using the additional overhead processing of the plug-in though and PHx does seem to cause odd compatibility issues. Thanks for the PHP example and for sharing your insights - I appreciate it!

      BTW - the issue I was having turned out to be related to a json call to the Vimeo API causing the 500 error. Still not clear why, but I removed the call to their API (using it to pull in a video thumbnail) and just substituted an image TV instead and everything is working fine now.

      Cheers!
        Greg Cole
        Esper Media
      • You could also have the TV (a checkbox) actually embed the desired chunk. The option can have the chunk tags as its value. Then all you would need would be the TV tag.
        Show=={{sidebarQuote}}

        See http://sottwell.com/tv-input-types.html and the section on using checkboxes to select sidebar blocks.
          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
          • 14214
          • 299 Posts
          Have been fighting this one for a few days and finally attributed the error to FileDownloadPlugin. Disabled and it killed the error.