Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
In Media how I can use File name instead of id?
example in Content:
i need to use only filename and foldername how i can resolve?
Hi,
Media has a property called umbracoFile.
Razor Typed
var media = Umbraco.TypedMedia(1234); <img src="@media.GetPropertyValue("umbracoFile")" alt="@media.GetPropertyValue("Name")"/>
Razor Dynamic
var media = Umbraco.Media(1234);
https://umbraco.com/follow-us/blog-archive/2011/2/24/umbraco-47-razor-feature-walkthrough-part-2/
thank Now i have to use a path like this: /media/folder/filename.pdf
in a javascript file
how i can do it, using filename instead of id? In javascript i can't use @Umbraco syntax
If javascript is inline in view, you can use the media variable in javascript:
@ { var media = Umbraco.TypedMedia(1234); } <script type="text/javascript"> var urlfile = '@media.GetPropertyValue("umbracoFile")'; </script>
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.
Continue discussion
use Media
In Media how I can use File name instead of id?
example in Content:
i need to use only filename and foldername how i can resolve?
Hi,
Media has a property called umbracoFile.
Razor Typed
Razor Dynamic
var media = Umbraco.Media(1234);
https://umbraco.com/follow-us/blog-archive/2011/2/24/umbraco-47-razor-feature-walkthrough-part-2/
thank Now i have to use a path like this: /media/folder/filename.pdf
in a javascript file
how i can do it, using filename instead of id? In javascript i can't use @Umbraco syntax
If javascript is inline in view, you can use the media variable in javascript:
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.