Get User Object for a given Entry I am trying to use the relatedTo parameter to get user details for a given entry with this code:

{% for entry in craft.entries.section('blog').limit(1) %}

    {{ entry.title }}

    {% set authorDetails =  craft.users.relatedTo(entry) %}

    {% for person in authorDetails %}
        {{ person.firstName }} {{ person.lastName }}
    {% endfor %}

{% endfor %}


The Title returns fine, but nothing else. First time I have used relatedTo and guess there is something I don't understand about usage. Any advice greatly appreciated!

Roi
If you're just looking to get the author of an entry, it's a simple as:

{% for entry in craft.entries.section('blog').limit(1) %}

    {{ entry.title }}

    {{ entry.author.firstName }} {{ entry.author.lastName }}

{% endfor %}


If you're looking to get every user associated with every Users field for an entry, your relatedTo syntax will work:

{% for entry in craft.entries.section('blog').limit(1) %}

    {{ entry.title }}

    {% set allRelatedUsers =  craft.users.relatedTo(entry) %}

    {% for user in allRelatedUsers %}
        {{ user.firstName }} {{ user.lastName }}
    {% endfor %}

{% endfor %}


The reason that returned nothing in your original question is because the "author" field isn't a proper Users field type - it's more of a special case user field.