12 Oct
2001
12 Oct
'01
4:06 p.m.
Hello, I'd like to sort the folders in my tree tag by a property index.
The problem is that not every folder has this property. So when I do <tree ... sort=index> I get an error, when a folder does not have that property index. How can I avoid that error? I'd like to do s. th. like <tree ... (sort=index missing=0)>
write a small script (python), get_index try: my_index = context.index except: my_index = 0 return my_index now with <tree .. sort=get_index> and the magic of acquisition, it should work. cheers, oliver