1

I have a 'Profile' channel that gives the profile of people.

I have 'Last name' as the title, 'first name' and I'd like to use first name in the slug rather than have to add the first name to the title and then need to create another field to store the last name.

I thought, similar to {entry.type} I could've gone for {entry.firstName} but that doesn't work.

Possible?

1 Answer 1

3

Firstly I'd recommend splitting the first name and last name into seperate fields. That way in your templates it would look nicer:

{{ member.firstNameField }} {{ member.lastNameField }}

than having:

{{ member.firstNameField }} {{ member.title }}

when outputting their names.

Once you have done that, in your entry type settings you can set the entry title to run off these first name and last name fields:

{firstNameField} {lastNameField}

The slug will be automatically generated from this as well. I may have mis-understood your question, but I hope that helps.

2
  • 2
    Jamie. I would suggest just setting the sections 'title' to { firstName } { lastName } and leave the 'uri' set to /people/{slug}. The slug will automatically pick up the title if left blank when saving the entry. It will also not throw an error if you have 2 records with the same firsName/lastName, and you will still be able to use the 'slug' attribute in your templates if you need to. Commented Feb 11, 2015 at 15:02
  • @DouglasMcDonald Good thinking, thanks. I'll update the answer.
    – Jamie Wade
    Commented Feb 11, 2015 at 15:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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