Question

In one of our implementation of TBB we are using ItemPropertyFileNameSubFolder property of Item.We are migrating our application from 5.3 sp1 to Tridion 2011 Sp1 and the property ItemPropertyFileNameSubFolder doesnot exist in the latest version. The code snippet we are using is as below

 // Handle subfolder (todo: fix this, ItemPropertyFileNameSubFolder does not exist!!
 string subFolder = GetPropertyValue(item, Item.ItemPropertyFileNameSubFolder);
 if (subFolder != "") {
     if (subFolder.StartsWith("/")) {
         // Strip of leading /
         subFolder = subFolder.Substring(1);
     }
     if (!subFolder.EndsWith(PathSeparator)) {
         // Ensure there is always a separator at the end
         subFolder += PathSeparator;
     }
     fileName = subFolder + fileName;
 }

This basically retrieve the subfolder path from the property and prefix the filename with the value. Could you please provide me any alternative or workaround for the same.

Thanks Rajendra

Was it helpful?

Solution

This property was optional to begin with and might not even been set, which probably doesn't happen anyway otherwise you would have had an exception there.

You might as well leave it out, or (additionally) use Item.ItemPropertyFileNamePrefix when this prefix was not used already.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top