problem to add file path to javascript variable
Posted: Fri Aug 23, 2019 4:02 pm
I've been spending most of my day trying to figure out how to pass a filepath to a javascript variable in an external .js file. I have done this before in a plain .php / .js files, but never in CMSMS.
What I need is to get the path from this file
and assign the path to a javascript variable which is in this location
I've tried every php variable to js variable method I've found on stackoverflow, google, etc to do this but with no luck.
I've wrapped plain php and javascript in {literal} but nothing is working out.
I have also tried to use the smarty {capture} and {assign} but still it is not working.
Now I'm totally out of options...can anyone more experienced in cmsms help me out?
for more clarification: the file is an .mp3 and I need to assign it's path to the .js variable for reading the ID3 tags bound to the file.
What I need is to get the path from this file
Code: Select all
{$entry->file_location}/{$fields.Audio1->displayvalue}{$entry->fields.Audio1->displayvalue}
Code: Select all
/uploads/js/id3.js
I've wrapped plain php and javascript in {literal} but nothing is working out.
I have also tried to use the smarty {capture} and {assign} but still it is not working.
Now I'm totally out of options...can anyone more experienced in cmsms help me out?
for more clarification: the file is an .mp3 and I need to assign it's path to the .js variable for reading the ID3 tags bound to the file.