Full Path name Options
mizan
Posted: Sunday, October 19, 2008 6:56:41 AM
Rank: Enthusiast

Joined: 10/9/2008
Posts: 26
Location: London
Hi all,


I am trying to get the full path name using a node id and used this method but it does not seem to work

umbraco.library.NiceUrlFullPath(1044)

I am trying to get structure as /media/232/


I am using on a usercontrol.

Please help. Thanks

Mizan

I am only trying
rsoeteman
Posted: Sunday, October 19, 2008 9:03:28 AM

Rank: Aficionado

Joined: 4/3/2008
Posts: 103
Location: The Netherlands
Hi Mizan,

NicUrl or NiceUrlFormat will only work on content Nodes. Media is a different type. Below you find a piece of code that returns the path of the media (it also includes the filename).

Code:
Literal1.Text = umbraco.library.GetMedia(1331, false).Current.SelectSingleNode("//data[@alias=\"umbracoFile\"]").Value;


What I'm doing is first access the Media Item. The false paramter indicates that I only want to access the single Item. This returns an xPathNodeIterator where I retreive the Umbraco filename from.

Hope this helps,

Richard

ASP.NET and Umbraco development - Soeteman Software
mizan
Posted: Sunday, October 19, 2008 5:32:20 PM
Rank: Enthusiast

Joined: 10/9/2008
Posts: 26
Location: London
Hi Richard,

Thanks for providing a very quick response.

The code works well if I want to get the file name with the path. If there are no media in the node you can't get the media id and therefore you can't get the path name.


What I want is to get the full path by selecting/inputting the folder node id.

Help would be appreciated.

Thank you.

Mizan



I am only trying
Users browsing this topic
Guest


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.