Keyword

k2fields - providing you additional extra fields and extended select

  • Gobezu Sewu
  • Gobezu Sewu's Avatar Topic Author
  • Offline
  • Senior Member
More
14 years 11 months ago #79609 by Gobezu Sewu
@Followeyes here comes some more detailed examples

In your above example each row corresponds to one k2fields. So what you should do is paste each of those row in the Name field of an extra field of the type Text Field. So breaking it down as follows and also aided by the attached picture visualizing whats written below:

Example 1. if you create a Text Field with the name containing the following k2fields syntax:

k2f---valid=datetime:::low=+0:::high=+3:::required=true---Datum

it would give you one editable datetime k2fields with current year as least available and current year + 3 years forward as maximum available and where the field name is Datum

Example 2. If you again create another extra field of the type Text Field and paste the following in the name of the field

k2f---block=true:::valid=number:::interval=[200,10000]:::list=conditional:::listmax=5---Text test

it would give you a number field (with the name "Text test") which allows entry of values between 200 and 10000. Having list enabled on this field (list=conditional) user would be able to add 5 varying values (listmax=5). Besides since the is conditional (list=conditional) user would be able to give conditions for each value as well. Since block=true k2fields checks if given values for this particluar field are of valid type and if not it will not allow submission of the item form.

Example 3. In case of this third example, lets skip it for a while as it have to do with extending the stock K2 select list so that user can add values

Example 4. k2f---valid=number:::interval=[200,10000]:::list=conditional:::listmax=5:::conditions=Daily%%Weekly%%Monthly%
%Yearly---Rent

If you again create a new K2 extra field with the type Text Field with the above k2fields syntax in the name field you would get a field which allows values between 200 and 10000. As example 2 above the user is allowed to enter 5 different values and this time the field have fixed conditions, with drop down and the values avialable for selection are those given in conditions=Daily%%Weekly%%Monthly%%Yearly. Each condition separated by "%%", thus Daily, Weekly, Monthly and Yearly being those available as conditions

In the attached picture you will be able to see how it all works out

Good luck and let me know if you have any further ideas or questions
Attachments:

Please Log in or Create an account to join the conversation.

More
14 years 11 months ago #79610 by FeSys
Thank you very much for detailed example.. But am not sure what I miss here..
it shows only the code.


..You may help!
Gobezu Sewu said:@Followeyes here comes some more detailed examples In your above example each row corresponds to one k2fields. So what you should do is paste each of those row in the Name field of an extra field of the type Text Field. So breaking it down as follows and also aided by the attached picture visualizing whats written below:

Example 1. if you create a Text Field with the name containing the following k2fields syntax:

k2f---valid=datetime:::low=+0:::high=+3:::required=true---Datum

it would give you one editable datetime k2fields with current year as least available and current year + 3 years forward as maximum available and where the field name is Datum

Example 2. If you again create another extra field of the type Text Field and paste the following in the name of the field

k2f---block=true:::valid=number:::interval=[200,10000]:::list=conditional:::listmax=5---Text test

it would give you a number field (with the name "Text test") which allows entry of values between 200 and 10000. Having list enabled on this field (list=conditional) user would be able to add 5 varying values (listmax=5). Besides since the is conditional (list=conditional) user would be able to give conditions for each value as well. Since block=true k2fields checks if given values for this particluar field are of valid type and if not it will not allow submission of the item form.

Example 3. In case of this third example, lets skip it for a while as it have to do with extending the stock K2 select list so that user can add values

Example 4. k2f---valid=number:::interval=[200,10000]:::list=conditional:::listmax=5:::conditions=Daily%%Weekly%%Monthly%
%Yearly---Rent

If you again create a new K2 extra field with the type Text Field with the above k2fields syntax in the name field you would get a field which allows values between 200 and 10000. As example 2 above the user is allowed to enter 5 different values and this time the field have fixed conditions, with drop down and the values avialable for selection are those given in conditions=Daily%%Weekly%%Monthly%%Yearly. Each condition separated by "%%", thus Daily, Weekly, Monthly and Yearly being those available as conditions

In the attached picture you will be able to see how it all works out

Good luck and let me know if you have any further ideas or questions

Please Log in or Create an account to join the conversation.

  • Gobezu Sewu
  • Gobezu Sewu's Avatar Topic Author
  • Offline
  • Senior Member
More
14 years 11 months ago #79611 by Gobezu Sewu
@Followeyes may I start by asking, is the k2fields plugin you installed enabled?

Please Log in or Create an account to join the conversation.

More
14 years 11 months ago #79612 by FeSys
Yes "Gobezu Sewu", I installed as usual joomla extension install, then enable it from the plug-in manager.

Gobezu Sewu said:@Followeyes may I start by asking, is the k2fields plugin you installed enabled?

Please Log in or Create an account to join the conversation.

More
14 years 11 months ago #79613 by Tamas Darvas
after I installed the plugin and tried to open an "edit item" window on the frontend: Fatal error: Call to a member function get() on a non-object in ....../plugins/k2/k2fields.php on line 348

Gobezu Sewu said:fellow k2ists, thanks for the feedback, a maintenance update with the above issues addressed is uploaded

Please Log in or Create an account to join the conversation.

More
14 years 11 months ago #79614 by Tamas Darvas
fyi, I am leaving K2 for some time, since all the features I am looking for seem to be available in jSeblod.

Please Log in or Create an account to join the conversation.

  • Gobezu Sewu
  • Gobezu Sewu's Avatar Topic Author
  • Offline
  • Senior Member
More
14 years 11 months ago #79615 by Gobezu Sewu
@Followeyes is there anyway I can access your setup and look at the issue?

@Tamas I sincerely hope its not b/c of me ;), I am as well looking at jSeblod, but not as replacement of K2 b/c they all have their place and I will definitely continue to use K2 in contexts that doesn't require the so called "extra fields" within K2, good luck

Please Log in or Create an account to join the conversation.

More
14 years 11 months ago #79616 by FeSys
Sorry "Gobezu Sewu", it's a local setup for now.
Just wondering..
I installed the core K2 one by Fotis.
Where can i see the K2 plug-ins been installed & enabled, including yours?
Maybe then I will figure my mistake anywhere.

Gobezu Sewu said:@Followeyes is there anyway I can access your setup and look at the issue?
@Tamas I sincerely hope its not b/c of me ;), I am as well looking at jSeblod, but not as replacement of K2 b/c they all have their place and I will definitely continue to use K2 in contexts that doesn't require the so called "extra fields" within K2, good luck

Please Log in or Create an account to join the conversation.

  • Gobezu Sewu
  • Gobezu Sewu's Avatar Topic Author
  • Offline
  • Senior Member
More
14 years 11 months ago #79617 by Gobezu Sewu
@Followeyes ok, as I said on the download site, this was meant to be part of a larger project but have abandoned K2 for that specific project thus have not implemented it on any live site. It looks like I would need to setup a demo site. Will post here as soon as its done!

Btw, I didn't understand your reference to Fotis plugin?

Followeyes said:Sorry "Gobezu Sewu", it's a local setup for now. Just wondering.. I installed the core K2 one by Fotis. Where can i see the K2 plug-ins been installed & enabled, including yours?
Maybe then I will figure my mistake anywhere.

Gobezu Sewu said:@Followeyes is there anyway I can access your setup and look at the issue? @Tamas I sincerely hope its not b/c of me ;), I am as well looking at jSeblod, but not as replacement of K2 b/c they all have their place and I will definitely continue to use K2 in contexts that doesn't require the so called "extra fields" within K2, good luck

Please Log in or Create an account to join the conversation.

More
14 years 11 months ago #79618 by FeSys
Thank you.. Hope you the best always.
Gobezu Sewu said:
Btw, I didn't understand your reference to Fotis plugin?

I mean there is a plug-in by JoomlaWorks team (shown by Fotis) which too i installed, enabled and didn't konw where located in my K2 admin area.
Thanks for replay.

Gobezu Sewu said:@Followeyes ok, as I said on the download site, this was meant to be part of a larger project but have abandoned K2 for that specific project thus have not implemented it on any live site. It looks like I would need to setup a demo site. Will post here as soon as its done!
Btw, I didn't understand your reference to Fotis plugin?

Followeyes said:Sorry "Gobezu Sewu", it's a local setup for now. Just wondering.. I installed the core K2 one by Fotis. Where can i see the K2 plug-ins been installed & enabled, including yours? Maybe then I will figure my mistake anywhere.

Gobezu Sewu said:@Followeyes is there anyway I can access your setup and look at the issue? @Tamas I sincerely hope its not b/c of me ;), I am as well looking at jSeblod, but not as replacement of K2 b/c they all have their place and I will definitely continue to use K2 in contexts that doesn't require the so called "extra fields" within K2, good luck

Please Log in or Create an account to join the conversation.

  • Gobezu Sewu
  • Gobezu Sewu's Avatar Topic Author
  • Offline
  • Senior Member
More
14 years 11 months ago #79619 by Gobezu Sewu
I have found the issues @Followeyes and other users have commented on and have now released an upgrade version with the issues addressed as well as added a support for the excellent Googlemaps plugin

I have also added a front end demo

So do head over to the site and have a look

Please Log in or Create an account to join the conversation.

More
14 years 11 months ago #79620 by FeSys
Many Thanks "Gobezu Sewu", I guess the magic starts.. I'll give it a try.

Gobezu Sewu said:I have found the issues @Followeyes and other users have commented on and have now released an upgrade version with the issues addressed as well as added a support for the excellent Googlemaps plugin
I have also added a front end demo

So do head over to the site and have a look

Please Log in or Create an account to join the conversation.

More
14 years 11 months ago #79621 by FeSys
Okay.. Now I am happy with all that.. working for me finally..
Thank youuuuuuuuuuuuuuuuuuuuu ""Gobezu Sewu"".

Please Log in or Create an account to join the conversation.

  • Gobezu Sewu
  • Gobezu Sewu's Avatar Topic Author
  • Offline
  • Senior Member
More
14 years 11 months ago #79622 by Gobezu Sewu
Followeyes I am glad you find it working and also to some use ;)

Best!

Please Log in or Create an account to join the conversation.

More
14 years 10 months ago #79623 by Line Wied
Thank you very much for this plugin.

Im using it for a date extra field. Works fine in item view and in category lists, but when items are displayed by tag, it shows the "k2f---valid=datetime---Dato" instead of the name.

Please Log in or Create an account to join the conversation.

  • Gobezu Sewu
  • Gobezu Sewu's Avatar Topic Author
  • Offline
  • Senior Member
More
14 years 10 months ago #79624 by Gobezu Sewu
Hi Line,

Great to hear that it is been useful.
Thanks for letting me know about this issue and I had never used the tag view. Now that I have looked into it you are indeed correct.

But unfortunately whenever the task is tag K2 doesn't seem to load the k2 plugins (which k2fields is) nor call necessary events (which this plugin requires in order to function properly and w/o having K2 core hacks in play). So atm there is not much we can do.

If you wouldn't mind putting a K2 core hack in place I would be able to provide you such modification or if you would like to do it yourself open components/com_k2/models/item.php and look at row # 332 and change one of the clauses currently looking as follows:

($view=='itemlist' && ($task=='' || $task=='category') && $item->params->get('catItemK2Plugins')) ||

to

($view=='itemlist' && ($task=='' || $task=='category' || $task=='tag') && $item->params->get('catItemK2Plugins')) ||

Let me know how this works out for you...

Line Wied said:Thank you very much for this plugin.
Im using it for a date extra field. Works fine in item view and in category lists, but when items are displayed by tag, it shows the "k2f---valid=datetime---Dato" instead of the name.

Please Log in or Create an account to join the conversation.

More
14 years 10 months ago #79625 by scyllar
this is awesome! thanks for the great plugin and will test it!

Please Log in or Create an account to join the conversation.

More
14 years 10 months ago #79626 by Line Wied
Thank you for your answer and the small hack solution. I prefer not to hack core files, so for now I will work out a way not to output the extra fields when task=tag in a template, or just hide the extra fields name.

Thanks again,
Line

Please Log in or Create an account to join the conversation.

  • Gobezu Sewu
  • Gobezu Sewu's Avatar Topic Author
  • Offline
  • Senior Member
More
14 years 10 months ago #79627 by Gobezu Sewu
Hi Toni,
Just checked your examples and works fine for me.
May I ask, have you enabled the plugin.
What is the result you see when editing the item.
Would you mind posting a screen cap of the extra field tab when editing an item in a category to which you assigned the extra field group which contains those extra fields.
Thank you!

Toni said:hi,
k2f---valid=url---Link

and k2f---valid=email---Mail

don´t work -.-

Please Log in or Create an account to join the conversation.

More
14 years 9 months ago #79628 by Markus Thiel
I really like the idea here.. but the plugin is to complicated and looks like a hack or something... will wait for a more "Complete" solution.. but keep up the great work!!

Please Log in or Create an account to join the conversation.


Powered by Kunena Forum