We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 31156
    • 1 Posts
    I have a Template variable that is assigned to the creator of the software.
    People will then be able to do a search for all pages with software by a specific vendor using tvExplorer.

    I was wondering if there was a way to auto populate the drop down menu they use for the search with all choices in my vendor TV.
      • 4310
      • 2,310 Posts
      Something like this?
      <?php
      $output = '';
      $TVarray = $modx->getTemplateVarOutput(array('vendorTV'));
      if(!empty($TVarray['vendorTV'])){ 
      $output .= '<select id="vendor">';
      $values = $TVarray['vendorTV'];
      foreach($values as $value){
      $output .= '<option value="'.$value.'">'.$value.'</option>';
      }
      $output .= '</select>';
      }
      return $output;
      ?>

      You’d need some sort of action either JS or POST to send the value somewhere.