November Happy Hour will be moved to Thursday December 5th.

Setting the URL segment on a media item?

Vote:
 

Is it possible to set the URL segment on a media file?  I can't find a property for it.

#115733
Jan 16, 2015 18:57
Vote:
 

When in forms/all-properties mode when editing a media file, you should be able to set the URLSegment via the "Name in URL" field. Although I suspect you may have additional layers to this question :).

#115738
Edited, Jan 16, 2015 20:40
Vote:
 

I meant programatically, not from the interface, sorry.  From the API.

#115739
Jan 16, 2015 20:54
Vote:
 

I believe the property is contentLink - http://world.episerver.com/documentation/Class-library/?documentId=cms/7.5/6B7F362

Basing this on a few examples:

http://world.episerver.com/documentation/Items/Upgrading/EPiServer-CMS/75/Migrating-VPP-based-files-to-the-new-media-system/

http://world.episerver.com/forum/developer-forum/-EPiServer-75-CMS/Thread-Container/2014/1/Get-media-files/

http://roland.kierkels.net/episerver/blob-storage-in-episerver-7-5/

#115740
Jan 16, 2015 21:12
Vote:
 

If you cast your MediaData object to IContent you can access the UrlSegment property.

#115741
Jan 16, 2015 21:49
Vote:
 

There does not seem to be a UrlSegment property on IContent.

#115742
Jan 16, 2015 21:54
Vote:
 

I'm on my phone now. But there might be an IRoutable interface then.

#115743
Jan 16, 2015 22:05
Vote:
 

Yep, that was it, thanks.

#115744
Jan 16, 2015 22:11
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.