We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 13445 ☆ A M B ☆
    • 18 Posts
    Well still buzzed about attending MODxpo and thought I’d wade deep into creating my first few snippets from scratch. Unfortunately I’ve not be able to search out an answer on this. It’s one of those, I can see the problem but not quite grasp yet. I am making a snippet for a client’s site that will have multiple podcast on the same page. So far here is my code:
    Snippet:
    <?php
    $output = '';  // clear output
    $modx->setPlaceholder('playername', $playername);
    $modx->setPlaceholder('webcast', $webcast);
    $modx->setPlaceholder('webcasttitle', $webcasttitle);
    $output .= $modx->getChunk('podcast');
    return $output;
    ?>


    And I am calling it with this:
    [!podcast? &playername=`b2bIntegration` &webcast=`b2bpodcast.mp3` &webcasttitle=`Simplifying B2B Integration for Distributors` !]


    It works beautifully for one single podcast the issue I have is when I have more than one podcast on the same page. I can tell it’s taking the parameters from the second call and using those for each time it’s called. Think I’m getting over my head a bit but it’s one good way to learn. Unfortunately I’ve not been able to dig around on my own to find an answer to this. Any help pointing me in the right direction would be great!

    Thanks.
      Senior Designer at Arketi Group - http://www.arketi.com
      Twitter - @jalterixnar - https://twitter.com/jalterixnar

      “There is no dishonor in failing, only in the failure to try.” – Elder fire dragon Kaernyth
      • 4041
      • 788 Posts
      Give this snippet a try and see if it helps:
      <?php
      $output = '';  // clear output
      
      $podcast_array = array(
              'playername'   => $playername,
              'webcast'      => $webcast,
              'webcasttitle' => $webcasttitle
              );
      
      $output .= $modx->parseChunk('podcast', $podcast_array, '[+', '+]');
      
      unset($podcast_array);
      
      return $output;
      ?>
        xforum
        http://frsbuilders.net (under construction) forum for evolution
        • 13445 ☆ A M B ☆
        • 18 Posts
        Been a bit underwater and have not had a chance to reply. The code there worked beautify when combined with the wordpress audio player. Thanks a ton for the advice!
          Senior Designer at Arketi Group - http://www.arketi.com
          Twitter - @jalterixnar - https://twitter.com/jalterixnar

          “There is no dishonor in failing, only in the failure to try.” – Elder fire dragon Kaernyth