Hi,
I've created a form to upload an audio file and autocreate an joomla article. I want to insert a html5 audio player in the article with only this file.
<audio controls>
<source src="audio/lastupload.wav" type="audio/wav">
</audio>
How can I do that ?
Thanks a lot,
Julien Henocq
I've created a form to upload an audio file and autocreate an joomla article. I want to insert a html5 audio player in the article with only this file.
<audio controls>
<source src="audio/lastupload.wav" type="audio/wav">
</audio>
How can I do that ?
Thanks a lot,
Julien Henocq
Hi Julien,
you should be able to add the file name using {input_name} but with the name of your File upload element so you would add something like this to the article body
Bob
you should be able to add the file name using {input_name} but with the name of your File upload element so you would add something like this to the article body
<audio controls>
<source src="audio/{input_name}" type="audio/wav">
</audio>
Bob
Hi,
thanks for your answer.
I created a custom code module, with this code :
<?php
$form->data['new_player'] = "
<audio controls>
<source src="/audio/{file_upload}" type="audio/wav">
</audio>
";
?>
I put 'new_player' in the full text field of the joomla article,
and i have an error :
Parse error: syntax error, unexpected '{' in /home/users4/h/henocqjulien/www/soundbank/administrator/components/com_chronoforms5/chronoforms/actions/custom_code/custom_code.php(20) : eval()'d code on line 6
what's wrong ?
thanks
thanks for your answer.
I created a custom code module, with this code :
<?php
$form->data['new_player'] = "
<audio controls>
<source src="/audio/{file_upload}" type="audio/wav">
</audio>
";
?>
I put 'new_player' in the full text field of the joomla article,
and i have an error :
Parse error: syntax error, unexpected '{' in /home/users4/h/henocqjulien/www/soundbank/administrator/components/com_chronoforms5/chronoforms/actions/custom_code/custom_code.php(20) : eval()'d code on line 6
what's wrong ?
thanks
Hi Henocq,
You can’t use the {input_name} syntax in PHP :-( (or have "" inside ""). Please try
Bob
You can’t use the {input_name} syntax in PHP :-( (or have "" inside ""). Please try
<?php
$form->data['new_player'] = "
<audio controls>
<source src='/audio/{$form->data['file_upload']}' type='audio/wav' />
</audio>
";
?>
Bob
This topic is locked and no more replies can be posted.