News module and audio

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
midway31
Forum Members
Forum Members
Posts: 108
Joined: Fri Nov 23, 2007 1:11 am

News module and audio

Post 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>
User avatar
Rolf
Power Poster
Power Poster
Posts: 7825
Joined: Wed Apr 23, 2008 7:53 am
Contact:

Re: News module and audio

Post by Rolf »

- + - + - + - + - + - + -
LATEST TUTORIAL AT CMS CAN BE SIMPLE:
Migrating Company Directory module to LISE
- + - + - + - + - + - + -
Image
midway31
Forum Members
Forum Members
Posts: 108
Joined: Fri Nov 23, 2007 1:11 am

Re: News module and audio

Post by midway31 »

Rolf wrote:Use a GCB or a tag like https://www.cmscanbesimple.org/blog/mp3-made-simple
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
User avatar
Rolf
Power Poster
Power Poster
Posts: 7825
Joined: Wed Apr 23, 2008 7:53 am
Contact:

Re: News module and audio

Post by Rolf »

You still can use a Global Content Block...
- + - + - + - + - + - + -
LATEST TUTORIAL AT CMS CAN BE SIMPLE:
Migrating Company Directory module to LISE
- + - + - + - + - + - + -
Image
User avatar
Rolf
Power Poster
Power Poster
Posts: 7825
Joined: Wed Apr 23, 2008 7:53 am
Contact:

Re: News module and audio

Post 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
- + - + - + - + - + - + -
LATEST TUTORIAL AT CMS CAN BE SIMPLE:
Migrating Company Directory module to LISE
- + - + - + - + - + - + -
Image
User avatar
Rolf
Power Poster
Power Poster
Posts: 7825
Joined: Wed Apr 23, 2008 7:53 am
Contact:

Re: News module and audio

Post by Rolf »

Uhm, looks like the Google Player (and so my UDT) isn't working anymore... bummer
- + - + - + - + - + - + -
LATEST TUTORIAL AT CMS CAN BE SIMPLE:
Migrating Company Directory module to LISE
- + - + - + - + - + - + -
Image
midway31
Forum Members
Forum Members
Posts: 108
Joined: Fri Nov 23, 2007 1:11 am

Re: News module and audio

Post 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
User avatar
Rolf
Power Poster
Power Poster
Posts: 7825
Joined: Wed Apr 23, 2008 7:53 am
Contact:

Re: News module and audio

Post by Rolf »

Rolf wrote: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
- + - + - + - + - + - + -
LATEST TUTORIAL AT CMS CAN BE SIMPLE:
Migrating Company Directory module to LISE
- + - + - + - + - + - + -
Image
User avatar
Jo Morg
Dev Team Member
Dev Team Member
Posts: 1978
Joined: Mon Jan 29, 2007 4:47 pm

Re: News module and audio

Post 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):
  1. If you use only need one audio file which can be fixed on the detail template:
    1. create a new News Field Definition
    2. on your detail template just call it:

      Code: Select all

      <audio id="player2" src="{$entry->fields.foo->value}" type="audio/mp3" controls="controls">        
      </audio> 
  2. If you use a GCB:
    1. Create a new GCB named Player;
    2. Use something like this:

      Code: Select all

      <audio id="player2" src="{$gcb_params.src}" type="audio/mp3" controls="controls">
      </audio> 
    3. Call it like this from any template:

      Code: Select all

      {global content name='Player'  src='uploads/media/audio/mp3name.mp3'} 
  3. And you can use an UDT:
    1. Create a new one called Audio_Player
    2. Code: Select all

      echo '<audio id="player2" src=" ' . $params['src'] . '" type="audio/mp3" controls="controls"';
    3. 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... ;)
"There are 10 types of people in this world, those who understand binary... and those who don't."
* by the way: English is NOT my native language (sorry for any mistakes...).
Code of Condut | CMSMS Docs | Help Support CMSMS
My developer Page on the Forge
GeekMoot 2015 in Ghent, Belgium: I was there!
GeekMoot 2016 in Leicester, UK: I was there!
DevMoot 2023 in Cynwyd, Wales: I was there!
midway31
Forum Members
Forum Members
Posts: 108
Joined: Fri Nov 23, 2007 1:11 am

Re: News module and audio

Post 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'}
Post Reply

Return to “Modules/Add-Ons”