You should be able to use @parentID. Let's say that you have a media picker with an alias of "myPicker". With this picker you'll select a media node that have a parent. Let's put that node in a variable like this:
Now you should be able to get the selected node's parent using the GetMedia extension and $selectedMedia/@parentID. E.g. you could write out the parent node in a textarea to see the XML of that node like this:
How do I getting a media parent id
I know a media nodes xml is a bit different than content nodes xml.
What is the best way to get a media item's parent node?
I've tried @parentId with no success.
I think I can't see the forest through the trees.
Thanks in advance.
You could try to play with xpath axes right here: http://pimpmyxslt.com/
Take a look at the one called parent::
Try something like this ./parent::folder
As far as I know the parent element to a media has to be a folder, right ?
Parent can be any type.. depends on how you setup media structure. In most cases it's Folder.
I'll try the parent:: element
Didn't work.. any other suggestions?
@parentID seems to work fine for me. It is case sensitive though, were you using @parentID or @parentId?
-Tom
Hi Daniel
You should be able to use @parentID. Let's say that you have a media picker with an alias of "myPicker". With this picker you'll select a media node that have a parent. Let's put that node in a variable like this:
Now you should be able to get the selected node's parent using the GetMedia extension and $selectedMedia/@parentID. E.g. you could write out the parent node in a textarea to see the XML of that node like this:
/Kim A
is working on a reply...