- Posts: 2
COMMUNITY FORUM
Trying to access extra fields from another K2 Item
- Kendall Cabe - Times Two Technology
-
Topic Author
- Offline
- New Member
Less
More
10 years 2 weeks ago #143267
by Kendall Cabe - Times Two Technology
Trying to access extra fields from another K2 Item was created by Kendall Cabe - Times Two Technology
I need to access extra fields in K2 from item A while building the view for Item B.
I'm trying to use K2 as a way to do event locations and in each event, I want to grab the location details to show on the event itself. I have 2 different item types within K2 and different extra group fields.
How would I go about doing this?
I'm trying to use K2 as a way to do event locations and in each event, I want to grab the location details to show on the event itself. I have 2 different item types within K2 and different extra group fields.
How would I go about doing this?
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
-
- Offline
- Platinum Member
Less
More
- Posts: 15920
10 years 2 weeks ago #143326
by Krikor Boghossian
Replied by Krikor Boghossian on topic Trying to access extra fields from another K2 Item
I think you need a custom built plugin.
I am not sure if one exists in the JED or getk2.org/extend/extensions/ .
Personally I would add a second set of extrafields in the event's details called location details or something similar.
Then with some coding you can separate theses fields in the frontend and display them pretty much anywhere in the item's template.
I am not sure if one exists in the JED or getk2.org/extend/extensions/ .
Personally I would add a second set of extrafields in the event's details called location details or something similar.
Then with some coding you can separate theses fields in the frontend and display them pretty much anywhere in the item's template.
Please Log in or Create an account to join the conversation.
- Kendall Cabe - Times Two Technology
-
Topic Author
- Offline
- New Member
Less
More
- Posts: 2
10 years 2 weeks ago #143365
by Kendall Cabe - Times Two Technology
Replied by Kendall Cabe - Times Two Technology on topic Trying to access extra fields from another K2 Item
Is there any information on building a plugin?
I've found the example K2 plugin here: getk2.org/extend/extensions/90-example-k2-plugin-for-developers
What I'm trying to figure out is if I can use a custom form field in K2. In the plugin it uses a text field. Can I create a custom form field type for Joomla that pulls data from the database?
What I'm really trying to do is add a new form field type to K2. I'd like to use the field more than once in the backend on an item, so I'd like to have a new form field type of "location" that pulls in a list of locations.
or, do you know of a plugin that already allows me to add a field type that lets me choose a K2 item from within another item in the backend so I can display that data on the event item.
I hate to reinvent the wheel, but I'm not really seeing a good way to do this where I could have a custom K2 field type. That would be the best solution.
I've found the example K2 plugin here: getk2.org/extend/extensions/90-example-k2-plugin-for-developers
What I'm trying to figure out is if I can use a custom form field in K2. In the plugin it uses a text field. Can I create a custom form field type for Joomla that pulls data from the database?
What I'm really trying to do is add a new form field type to K2. I'd like to use the field more than once in the backend on an item, so I'd like to have a new form field type of "location" that pulls in a list of locations.
or, do you know of a plugin that already allows me to add a field type that lets me choose a K2 item from within another item in the backend so I can display that data on the event item.
I hate to reinvent the wheel, but I'm not really seeing a good way to do this where I could have a custom K2 field type. That would be the best solution.
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
-
- Offline
- Platinum Member
Less
More
- Posts: 15920
10 years 2 weeks ago #143373
by Krikor Boghossian
Replied by Krikor Boghossian on topic Trying to access extra fields from another K2 Item
So you basically need a new extrafield type, a 'relationship type' one.
Have you checked the JED for any extensions that provide that functionality?
Have you checked the JED for any extensions that provide that functionality?
Please Log in or Create an account to join the conversation.