On Your Own: Adding Additional Fields to the Content Migration

It's time to put your new skills to work! Add three fields to our fields migration and then run it to add the remaining fields in the contact form.

Our con­tact form is miss­ing some fields. We still need to add fields for com­pa­ny, phone num­ber, and a mes­sage. Now that you have expe­ri­ence cre­at­ing fields in a Craft con­tent migra­tion, go ahead and cre­ate those fields yourself. 

A few tips:

  • All of the fields will be of the type Plain Text.
  • The mes­sage field will need to be mul­ti­line, and you can set a min­i­mum rows count. 
  • Add a char­ac­ter lim­it to the phone num­ber field to con­strain its length.

Once you have the fields defined, don’t for­get to add the code to the return state­ment to cre­ate those new fields!

Instructor
Ryan Irelan
Level
Intermediate
Date Published
November 03, 2021
Ryan Irelan

I am the creator of CraftQuest, a web developer, and former software team manager. I spend most of my time improving CraftQuest with code and courses. When I'm not in front of the computer, I spend my time with my family, and running on the roads and trails of Austin, TX.