Take the 2-minute tour ×
Craft CMS Stack Exchange is a question and answer site for administrators, end users, developers and designers for Craft CMS. It's 100% free, no registration required.

I have a blog. I want to output an entry author's first and last name. What is a good method to accomplish this?

share|improve this question

2 Answers 2

up vote 7 down vote accepted

For each entry, you can get the username of the author by simply using {{ entry.author }} (assuming entry is the variable containing the blog entry).

If you want to display Full name, first name and/or last name for one entry, you'd use:

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

For a list of entries and their authors, you'd use:

{% for entry in craft.entries.section('your-section').find() %}
    {{ entry.author.fullName }}
{% endfor %}
share|improve this answer

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

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.