Folder path from content id

In velocity templates, is it possible to generate the folder path if we have the content id?

thanks
Manvinder

If you’re wanting the folderpath of the content item you are previewing/publishing, you can use:

$user.psoFolders.getParentFolderPath($sys.assemblyItem)

For getting the folderpaths of other items from a template, given just their sys_contentid, it’s a little more tricky. A content item may be in multiple folders or possibly not in a folder at all.

If you are certain that the item you want is in just one folder, this might work for you:

#set ($itemGuid = $user.psoObjectFinder.getGuidById($sys_contentid)) ##
$user.psoFolders.getParentFolderPath($itemGuid)