Page 1 of 1
News module and audio
Posted: Wed Jul 31, 2013 2:33 am
by midway31
TinyMCE strips this code and need a solution as to how to use it in the news module for audio. Any suggestions please?
Code: Select all
<audio id="player2" src="uploads/media/audio/mp3name.mp3" type="audio/mp3" controls="controls">
</audio>
Re: News module and audio
Posted: Wed Jul 31, 2013 6:14 am
by Rolf
Re: News module and audio
Posted: Wed Jul 31, 2013 6:42 am
by midway31
Thanks for that but coding is not my forte and I need the html audio tag so it plays in all browsers especially mobile and i beleive flash will not work on ipad iphone etc
Re: News module and audio
Posted: Wed Jul 31, 2013 7:42 am
by Rolf
You still can use a Global Content Block...
Re: News module and audio
Posted: Wed Jul 31, 2013 7:45 am
by Rolf
Ohw wait... Try
https://www.cmscanbesimple.org/blog/fle ... wyg-editor Is written for CGBlog but with small parameter change will also work for News module
Grtz. Rolf
Re: News module and audio
Posted: Wed Jul 31, 2013 10:15 am
by Rolf
Uhm, looks like the Google Player (and so my UDT) isn't working anymore... bummer
Re: News module and audio
Posted: Wed Jul 31, 2013 9:29 pm
by midway31
I forgot to mention that i have 4 news catagories eg
1 media releases
2 video
3 audio
4 speeches and opinions
The audio is a twice weekly news item so needs to be easy for client or myself to enter. So i think a GCB is a bit messy
Re: News module and audio
Posted: Wed Jul 31, 2013 10:02 pm
by Rolf
Re: News module and audio
Posted: Wed Jul 31, 2013 10:45 pm
by Jo Morg
midway31 wrote:TinyMCE strips this code and need a solution as to how to use it in the news module for audio. Any suggestions please?
Code: Select all
<audio id="player2" src="uploads/media/audio/mp3name.mp3" type="audio/mp3" controls="controls">
</audio>
If I'm not wrong there are a few ways to tackle this (besides what Rolf suggested):
- If you use only need one audio file which can be fixed on the detail template:
- create a new News Field Definition
- on your detail template just call it:
Code: Select all
<audio id="player2" src="{$entry->fields.foo->value}" type="audio/mp3" controls="controls">
</audio>
- If you use a GCB:
- Create a new GCB named Player;
- Use something like this:
Code: Select all
<audio id="player2" src="{$gcb_params.src}" type="audio/mp3" controls="controls">
</audio>
- Call it like this from any template:
Code: Select all
{global content name='Player' src='uploads/media/audio/mp3name.mp3'}
- And you can use an UDT:
- Create a new one called Audio_Player
-
Code: Select all
echo '<audio id="player2" src=" ' . $params['src'] . '" type="audio/mp3" controls="controls"';
- Call it:
Code: Select all
{Audio_Player src='uploads/media/audio/mp3name.mp3'}
I didn't test any of these but these should work with a few tweaks.
HTH.
PS: Rolf may find the GCB option familiar...

something Calguy1000 once suggested...

Re: News module and audio
Posted: Wed Jul 31, 2013 11:49 pm
by midway31
Ok thanks for that. The UDT worked. But if someone could suggest a tweak to the call in article for client who is not savvy instead of this having to be entered in summary and content by simply browsing to file and entering the url like inserting a link
Code: Select all
{Audio_Player src='uploads/media/audio/mp3name.mp3'}