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. You can choose from the available field types:
- Text field
- Text area
- Drop-down selection
- Multi-select list
- Radio buttons
- Link
- CSV data
- Searchable labels
- Date
- Image
- Header
- 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.
- Click "Save & Close".
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 these changes when you're finished.
Step #5. Check the end result
Go to your public site to confirm the extra fields are indeed working.
What's Next?
What's Next?
Save $1,000's when you sign up for Joomlashack's Everything Club.
You will get your hands on our extensive range of over 20 extensions, plus legendary support!