Gale Petersen
February 2, 2012
3:53pm
Hello. I have created a content type to hold an audio file and player, an image, and a description (Body). The only way I can get this to work out is to put the following html in the body field as default html and switch out the URL for each audio file:
<p><a href="http://bodieandkovitz.squarespace.com/storage/media/OWR_20060713_Heron_Habitat_Protection_SallieBodie.mp3">Listen to the Story of Herons.</a></p><p>More unlinked text here.</p><p><script type="text/javascript" src="http://webplayer.yahooapis.com/player-beta.js"></script></p>
This works and I have a nice Yahoo media player that is swell. BUT, is there a cleaner way to do this using link fields or other text fields?
Thanks very much.
Comments
7:30pm
Hi Gale,
First, you need to enable the JavaScript Libraries module under Admin > Modules as shown in this screenshot:
https://skitch.com/e-stacywray/g9u9u/modules-story-restory (enable JS)
Anytime you're adding JavaScript code to your site, you need to create a RAW text format first and then paste in the JS code into the HTML tab of your WYSIWYG editor.
Here is where you would add a new text format:
https://skitch.com/e-stacywray/g9u97/text-formats-story-restory (text formats)
For more information about using JavaScript Libraries, please read our documentation on Extending the functionality of your site using third-party JavaScript Libraries.
It's very likely that you could add a custom JavaScript Library for Yahoo's Media Player.
Hope this info helps!
Best regards,
Stacy Wray | Drupal Gardens Client Advisor