K2 is a popular extension to build sites with CCK capabilities. Its flexibility makes it possible to add custom fields to manage additional text, images, links, etc.
In this tutorial, you will learn how to create extra fields within your K2 items.
Step #1. Create the Extra fields group
- Go to Components
- K2
- Extra fields groups
- New
- Type a Group name
- Save and close
Step #2. Create Extra fields
- Go to Components > K2 > Extra fields
- Click New
Enter the required details:
- Name
- Group. Choose the one you just created in the previous step.
- Type. Choose from the available field types:
- Required. Set as "yes" if this field is mandatory.
- Set a Default value if needed
- Save and close when you’re done.
Repeat the process to add more fields.
Step #3. Assign the Extra fields group to a category
Let's connect the extra fields group with a K2 category:
- Components > K2 > Categories
- Edit or create a category
- Associated "Extra Fields Group". Select the one you created in step 1.
Step #4. Create a K2 item
- Create a K2 item through Components > K2 > Items > New
- Set a title
- Choose the category
- Look in Extra Fields tab to fill in the custom fields:
Save when you're done.
Step #5. End result
Go to your public site to confirm the extra fields are indeed working.
About the author
Valentín creates beautiful designs from amongst the tequila plants of Jalisco, Mexico. You can see Valentín's design work all over this site and you can often find him helping members in our support forum.