sort ifs and elses in sidebar_links tag