I want to assign a variable do different values depending on if a variable exists, is this possible? My non working example might make it clearer:
{% if user
Create a template tag that takes username and recent_users as arguments which then outputs the menu. That way you will keep your template clean from that kind of logic.