Similarly to how Craft knows that a category is defined when a category slug is used, is there a way to detect a user in the same way?
{% if category is defined %}
...
{% endif %}
Something along the lines of (which only returns true if a user is logged in):
{% if user is defined %}
...
{% endif %}
If a username is in the URL, would/should above code return true similarly to how {% if category is defined %}
returns true if a category slug is in the URL? (i.e. .com/news/sherlock_holmes
)
I'm able to return author posts using method listed in this question, I'm just trying to simplify even further and have one template list all these views.