Answers.Body: <p>Well, I was 1 minute away from solving this, so I'll post my answer.</p>
  
  <pre><code>{% set author = craft.users.firstName(authorName.0).lastName(authorName.1).first() %}
  </code></pre>
  
  <p>Once the <code>author</code> object is set, you can access the <code>{{ author.id }}</code>.</p>
  
  <p>Allowing me to neatly return author entries:</p>
  
  <pre><code>{% set entries = craft.entries.section('news').authorId(author.id).limit('10') %}
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-01-22T05:36:01.583Z
Answers.Text: What happens when 2 or more people share the same first and last name? You'll just be grabbing the first result returned and ignoring the rest.
Answers.UserDisplayName: Brad Bell
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-01-22T14:44:49.717Z
Answers.Text: Errrr, fair point, though it will never be the case for this particular site. Is there another way of handling it without having an email address or id in the url?
Answers.UserDisplayName: Ryan Shrum
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-01-22T16:06:07.913Z
Answers.Text: usernames are unique.
Answers.UserDisplayName: Brad Bell
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-01-22T18:19:44.707Z
Answers.Text: I'm using email address as username. One solution would be to have the user id as a segment for query purposes, but then have above method for human readable/SEO. i.e. `/news/author/1/john-doe`
Answers.UserDisplayName: Ryan Shrum
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-01-22T02:45:37.677Z
Answers.LastActivityDate: 2015-01-22T02:45:37.677Z
Answers.UserDisplayName: Ryan Shrum
Body: <p>Is there a way I can reverse use the User Model to return an <code>authorId</code> based on the first/last name (John Doe)?</p>
  
  <p>Basically, I'm converting the first/last to a readable URI segment (using email addresses as username and I want something more readable than an ID in the URL):</p>
  
  <pre><code>{{ entry.author.firstName|lower ~ '-' ~ entry.author.lastName|lower }}
  </code></pre>
  
  <p>Returns: <code>john-doe</code></p>
  
  <p>Then on the listing page, grabbing the URI segment, setting that back to a readable name and spliting to array.</p>
  
  <pre><code>{% set authorName = craft.request.segment(3)|replace({'-':' '})|title|split(' ') %}
  </code></pre>
  
  <p>Which gives me (the equivalent of):</p>
  
  <pre><code>Array
  (
    [0] =&gt; John
    [1] =&gt; Doe
  )
  </code></pre>
  
  <p>I'd like to get the author id to return all the entries from said author. I thought something along the lines of below would work:</p>
  
  <pre><code>{% set author = craft.users.firstName(authorName.0).lastName(authorName.1) %}
  </code></pre>
  
  <p>With the above, I get the error:</p>
  
  <blockquote>
    <p>Object of class Craft\ElementCriteriaModel could not be converted to string</p>
  </blockquote>
  
  <p>However, if I return <code>{{ authorName.0 }}</code> it returns a string.</p>
  
Tags: <users><entry><author>
Title: Find an authorId based on first and/or last name
ThreadText: # Find an authorId based on first and/or last name
  
  (Asked by: username_0 on 2015-01-22)
  
  Is there a way I can reverse use the User Model to return an `authorId` based on the first/last name (John Doe)?
  
  Basically, I'm converting the first/last to a readable URI segment (using email addresses as username and I want something more readable than an ID in the URL):
  
  ```
  {{ entry.author.firstName|lower ~ '-' ~ entry.author.lastName|lower }}
  
  ```
  
  Returns: `john-doe`
  
  Then on the listing page, grabbing the URI segment, setting that back to a readable name and spliting to array.
  
  ```
  {% set authorName = craft.request.segment(3)|replace({'-':' '})|title|split(' ') %}
  
  ```
  
  Which gives me (the equivalent of):
  
  ```
  Array
  (
    [0] => John
    [1] => Doe
  )
  
  ```
  
  I'd like to get the author id to return all the entries from said author. I thought something along the lines of below would work:
  
  ```
  {% set author = craft.users.firstName(authorName.0).lastName(authorName.1) %}
  
  ```
  
  With the above, I get the error:
  
  > Object of class Craft\ElementCriteriaModel could not be converted to string
  
  However, if I return `{{ authorName.0 }}` it returns a string.
  
  **Tags:** users, entry, author
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2015-01-22. Score: 2 | Accepted answer
  
  Well, I was 1 minute away from solving this, so I'll post my answer.
  
  ```
  {% set author = craft.users.firstName(authorName.0).lastName(authorName.1).first() %}
  
  ```
  
  Once the `author` object is set, you can access the `{{ author.id }}`.
  
  Allowing me to neatly return author entries:
  
  ```
  {% set entries = craft.entries.section('news').authorId(author.id).limit('10') %}
  
  ```
  
  > **Comments:**
  > **username_1**: What happens when 2 or more people share the same first and last name? You'll just be grabbing the first result returned and ignoring the rest.  
  > **username_0**: Errrr, fair point, though it will never be the case for this particular site. Is there another way of handling it without having an email address or id in the url?  
  > **username_1**: usernames are unique.  
  > **username_0**: I'm using email address as username. One solution would be to have the user id as a segment for query purposes, but then have above method for human readable/SEO. i.e. `/news/author/1/john-doe`  
  
  ---
  
  