New Snippet code
<?php
$output='';
$tvValue=$modx->getTemplateVarOutput('tvAudio',$modx->documentIdentifier);
$tvValueImage=$modx->getTemplateVarOutput('image',$modx->documentIdentifier);
if($tvValue['tvAudio']!='') $output.='<p id="player2"><a href="http://www.macromedia.com/go/getflashplayer">Get the Flash Player</a> to see this player.</p><p><a href="'.$tvValue['tvAudio'].'">Download File NOW!</a></p><script type="text/javascript">
var FU = { movie:"/assets/flash/mp3player.swf",width:"300",height:"120",majorversion:"7",build:"0",wmode:"transparent",
flashvars:"file='.$tvValue['tvAudio'].'&image='.$tvValueImage['image'].'&repeat=False&showdigits=false&displayheight=100&lightcolor=0xb22450&backcolor=0x990000&frontcolor=0xFFFFFF&autoscroll=true" };
UFO.create( FU, "player2");
</script>';
return $output;
?>
then make a TV called "image" and have it’s type be, you guessed it IMAGE.
Fantastic. Thank you.
I supposed one doesn’t have to use the itunes bits. I’m thinking to simply use media on my hosted space.
I should read and think this through.
Much appreciated.
Let me know if you have any issues.
startID is the folder number, in the manager it has numbers next to all folder and files, so where ever you have your podcasts at, use that containing folder number.
Each podcast is a new document, look at step 3 for how to get it to show up. I know it’s complicated, but stick with it, once you "get it" you’ll love it.
Hey Neon_Eddy - thanks for the encouragement. I appreciate it.
I figured one basic thing out - this might help other complete newbs like myself: Add [*Audio*] somewhere to your template - where you want the audio to appear.
Unfortunately for me, this only produces text that looks exactly like this:
assets/files/podcasts/episode1.mp3
But it’s a start. I suspect once I figure out the StartID thing, I’ll be in business.
But I don’t see a number next to my folders.
Are you talking about under Resources --> Manage Files?
Under there I see Assets. I drill down to assets / files / podcasts... no directory numbers anywhere.
Am I looking in the wrong place?
Thanks for any guidance you can offer.
in your main folder tree,
http://www.modxcms.com/editor-manager.html in the first graphic, there are little numbers next to the files and folders...
ok, you’re close... that "snippet" I built is for simply checking if a variable is present and then if it is, outputting the full player code.
so what you really need is [[audio_player]] in your template, then past in the snippet code from the guide and save it.
Wow thank you so much, this is amazing... how easy it is it implament in MODx, that is. I will use this tutorial A LOT. Thank you, so much; i’m really loving MODx.
i know this thread is old. but maybe someone can help me. the rss is perfect. i just can’t get the player to work. it looks like they have replaced the mp3player.swf with player.swf and i’ve actually tried both. but i still get the raw URL. with no video. any tips?
New player works for me. Did you add the ufo.js script that the author has on the page he made (listed above) too?