1
Discussion & Troubleshooting / How to use custom field value in media_template?
« on: September 23, 2009, 09:06:41 PM »
Hi there all,
For a new site I have added an additional field "images_autoload". It works just fine when uploading, viewing details and editing, but I can't seem to get it to work in a new file I created in the MEDIA folder.
Specifically. I have entered value "SPACE TAXI" in the new added "images_autoload" field. It shows it's value on the details page, but I would like to use the value in the HTML code inside the media folder.
Example; for a plain JPG image, the next code is used: <img src="{media_src}" etc...
This will insert the value of media_src into the jpg template inside the MEDIA folder.
I would like to use my value in image_autoload also using this technique, like:
<autostartPRG='{images_autoload}'> etc...
Unfortunately this doesn't work. I can use the value in images_autoload inside a temlate file, but not inside a template that is in the MEDIA folder.
Suggestions?
[Edit]
Alternatively, I found that I can use PHP inside these MEDIA templates. Maybe there is an easy way to read the contents of custom fields (in my case images_autoload) into some PHP variable?
[Edit 2]
I found that something like $testvalue="{image_autoload}"; works fine inside the details.html template, but it doesn't in MEDIA/ templates. Someone knows a way to "transport" the value to there?
For a new site I have added an additional field "images_autoload". It works just fine when uploading, viewing details and editing, but I can't seem to get it to work in a new file I created in the MEDIA folder.
Specifically. I have entered value "SPACE TAXI" in the new added "images_autoload" field. It shows it's value on the details page, but I would like to use the value in the HTML code inside the media folder.
Example; for a plain JPG image, the next code is used: <img src="{media_src}" etc...
This will insert the value of media_src into the jpg template inside the MEDIA folder.
I would like to use my value in image_autoload also using this technique, like:
<autostartPRG='{images_autoload}'> etc...
Unfortunately this doesn't work. I can use the value in images_autoload inside a temlate file, but not inside a template that is in the MEDIA folder.
Suggestions?
[Edit]
Alternatively, I found that I can use PHP inside these MEDIA templates. Maybe there is an easy way to read the contents of custom fields (in my case images_autoload) into some PHP variable?
[Edit 2]
I found that something like $testvalue="{image_autoload}"; works fine inside the details.html template, but it doesn't in MEDIA/ templates. Someone knows a way to "transport" the value to there?