- Posts: 80
COMMUNITY FORUM
How to create a new extra field type ?
- Aimery Marsily
- Topic Author
- Offline
- Premium Member
Less
More
12 years 6 months ago #65970
by Aimery Marsily
How to create a new extra field type ? was created by Aimery Marsily
Hi,
Is there a tutorial on how to create a plugin to add new extra-field type ? I need to create a type of new extra-field and to do an action on the OnBeforeK2Save...
Thanks a lot
Is there a tutorial on how to create a plugin to add new extra-field type ? I need to create a type of new extra-field and to do an action on the OnBeforeK2Save...
Thanks a lot
Please Log in or Create an account to join the conversation.
- william white
- Offline
- Platinum Member
Less
More
- Posts: 3722
12 years 6 months ago #65971
by william white
Replied by william white on topic Re: How to create a new extra field type ?
an example plugin
getk2.org/extend/extensions/date/item/90-example-k2-plugin-for-developers
can you not use a regular extra field, then test the value from the plugin and determine what to do?
getk2.org/extend/extensions/date/item/90-example-k2-plugin-for-developers
can you not use a regular extra field, then test the value from the plugin and determine what to do?
Please Log in or Create an account to join the conversation.
- Aimery Marsily
- Topic Author
- Offline
- Premium Member
Less
More
- Posts: 80
12 years 6 months ago #65972
by Aimery Marsily
Replied by Aimery Marsily on topic Re: How to create a new extra field type ?
Hi William ! Always on duty ;)
I already watched this plugin but it just show the triggers for Frontend.
What I need is to have a new extrafield type because if I use a text one, it couldn't be ok because I need to have this extrafield type in multple groups and always make a manipulation on it with the onbeforeK2save...
If I use a standart one must hardcode with if extrafield id equal XX do this.... and that's not realy powerfull for my needs. And I also can use regex like doing {mytype:XXXXX} because it must be user friendly and final users don't want/know to do it.
So for more efficiency I need to create a new type. But I can't find how...
But maybe I'm missing something, do you know an other way to do by using a standart one ?
Thanks
I already watched this plugin but it just show the triggers for Frontend.
What I need is to have a new extrafield type because if I use a text one, it couldn't be ok because I need to have this extrafield type in multple groups and always make a manipulation on it with the onbeforeK2save...
If I use a standart one must hardcode with if extrafield id equal XX do this.... and that's not realy powerfull for my needs. And I also can use regex like doing {mytype:XXXXX} because it must be user friendly and final users don't want/know to do it.
So for more efficiency I need to create a new type. But I can't find how...
But maybe I'm missing something, do you know an other way to do by using a standart one ?
Thanks
Please Log in or Create an account to join the conversation.
- Aimery Marsily
- Topic Author
- Offline
- Premium Member
Less
More
- Posts: 80
12 years 6 months ago #65973
by Aimery Marsily
Replied by Aimery Marsily on topic Re: How to create a new extra field type ?
Just to know, how would you do when you say : "test the value from the plugin"
I don't know how to do that from my plugin... I wanted to do it with onbeforeK2save but I don't know if it's the best and how ?
I don't know how to do that from my plugin... I wanted to do it with onbeforeK2save but I don't know if it's the best and how ?
Please Log in or Create an account to join the conversation.
- william white
- Offline
- Platinum Member
Less
More
- Posts: 3722
12 years 6 months ago #65974
by william white
Replied by william white on topic Re: How to create a new extra field type ?
I havent actually done it, but it goes along the lines as this
joomcar.net/description-k2eo
If you read the description on the website it says
This module consists of two parts:
module part (mod_k2_eo);
plugin part that provide ordering function.
A module to display, and a plugin to manipulate the data so to speak.
That is the general idea, probably a good idea to get this and read the code....when time permits
joomcar.net/description-k2eo
If you read the description on the website it says
This module consists of two parts:
module part (mod_k2_eo);
plugin part that provide ordering function.
A module to display, and a plugin to manipulate the data so to speak.
That is the general idea, probably a good idea to get this and read the code....when time permits
Please Log in or Create an account to join the conversation.
- Aimery Marsily
- Topic Author
- Offline
- Premium Member
Less
More
- Posts: 80
12 years 6 months ago #65975
by Aimery Marsily
Replied by Aimery Marsily on topic Re: How to create a new extra field type ?
Hmmm sorry but I don't understand why you talk about this, my aim is to create a new extra field...
Please Log in or Create an account to join the conversation.