0

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

Arjen Stobbe
  • 1,684
  • 9
  • 15
rdhaundiyal
  • 169
  • 10
  • Can we assume this is for a MM component? Also, what is the reason for changing the file name, and does it have to contain the folder name? – Chris Summers Mar 04 '13 at 12:26
  • Hi Chirs,The code was from some existing framework and after debugging i found that it was never getting hit, but to be sure(as there could be numerous scenarios which i cannot test) that there is not impact on functionality i am looking for an alternative rather than commenting the code snippet. – rdhaundiyal Mar 05 '13 at 05:21
  • Well without knowing what you want the code to actually do, it is almost impossible to suggest an alternative - What did the old code do? – Chris Summers Mar 05 '13 at 05:32
  • Hi Chris,Thanks for the reply,I just want to know if there is any corresponding property for Item.ItemPropertyFileNameSubFolder (which exist in 5.3 but does not exist in Tridion 2011) – rdhaundiyal Mar 05 '13 at 06:36

1 Answers1

1

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.

Arjen Stobbe
  • 1,684
  • 9
  • 15
  • Thanks Arjen, I have also checked and the property was not set anywhere in the code, but is there any chance of it being getting set by Tridion automatically. – rdhaundiyal Mar 06 '13 at 06:18