Smarty function to sort nodes in tree order
Remove debugging output wtf
Check for content availability when checking siblings

Works only when content is given, confusion ensues