Create CB fields

6 years 3 months ago #301189 by sylvain.ruda
Create CB fields was created by sylvain.ruda
Hi,

I need to use field types thar are not yet in the "standard" types of Community Builder :
- a date/time field without seconds and with no possibilities sto select a past date
- A single select list with two levels of items
- A range selector

Is it possible to create CB Fields ? Is there a documentation to do so ?

Regards,

Sylvain Ruda

Please Log in to join the conversation.

6 years 3 months ago #301193 by krileon
Replied by krileon on topic Create CB fields

- a date/time field without seconds and with no possibilities sto select a past date

This is doable. Create a datetime field then under Parameters > Display set "Edit Display" to "Custom". You can now supply PHP date function format for date and time. See the below PHP documentation on supported format values.

php.net/manual/en/function.date.php

- A single select list with two levels of items

That's an optgroup usage. This is also doable. Simply create an option for your select field and set "Group" to "Yes". That will create an optgroup with the supplied value as the label for all options following it.

- A range selector

This is the only fieldtype we don't have. There is no range fieldtype in CB at this time. Only thing I can suggest is create 2 integer fields.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in to join the conversation.

6 years 3 months ago #301236 by sylvain.ruda
Replied by sylvain.ruda on topic Create CB fields
Thank you for your answer. I have new questions :
- When i set the custom time format to H:i, the "seconds" selector don't dissepear from the "select your date/time" popin. How can i make it dissepear ?
- I want users only to select future days. How can i prevent them to select past days ?

For the range selector, can i create a field for CB ?

Please Log in to join the conversation.

6 years 3 months ago - 6 years 3 months ago #301240 by krileon
Replied by krileon on topic Create CB fields

- When i set the custom time format to H:i, the "seconds" selector don't dissepear from the "select your date/time" popin. How can i make it dissepear ?

Looks like a bug in the jQuery not accounting for the format template having seconds removed. Will take a look as part of the below feature ticket.

forge.joomlapolis.com/issues/6995

- I want users only to select future days. How can i prevent them to select past days ?

Should be able to do that by setting the minimum year to 0, +0, or maybe +1.

For the range selector, can i create a field for CB ?

If you're proficient with PHP and writing CB plugins, yes.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in to join the conversation.

6 years 3 months ago #301309 by sylvain.ruda
Replied by sylvain.ruda on topic Create CB fields
Thank you !

Is there any documentation on writting CB Plugins (i am proficient with PHP).

Please Log in to join the conversation.

6 years 3 months ago #301315 by krileon
Replied by krileon on topic Create CB fields

Is there any documentation on writting CB Plugins (i am proficient with PHP).

No not at this time. Best I can suggest is review an existing field plugin as an example. CB Query Field and CB Code Field both provide new field types in addition to extending existing field types. If you intend to create a range field it'd probably be easiest to extend the integer field.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.314 seconds