Updated 073 JCB Fields Type Extended (markdown)

Amigo 2019-10-28 15:32:11 +02:00
parent c8eaedf460
commit 97375bbe45
1 changed files with 7 additions and 1 deletions

@ -1,5 +1,7 @@
# JCB Fields Type Extended
[00:00:00](https://www.youtube.com/watch?v=91iIAuHZj38&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h00m00s)
I would like to give a demonstration and maybe some explanation about the functionality of a Custom field. Some tutorials about this had been given in the past but JCB has improved and there is a little bit of a different look [00:00:25](https://www.youtube.com/watch?v=91iIAuHZj38&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h00m25s) to that area. Let me do this again and show in the Compiler what it is actually doing. Here is a few views. [00:00:46](https://www.youtube.com/watch?v=91iIAuHZj38&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h00m46s) I've imported Sermon Distributor which is the most common demo component that I have used and it has a few Custom Fields so I could actually change this. This one is changed to Custom and we see that we've got a few Custom Fields here. The idea was that you would [00:01:15](https://www.youtube.com/watch?v=91iIAuHZj38&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h01m15s) use the demo components and then figure out how their Custom Fields work.
### Custom Fields Connect a table from one View to another
@ -18,10 +20,14 @@ In the Editor I would like to show you that Custom Fields are basically a Joomla
### Where to find the available extention options
To know what is all the available extending options we go to Joomla Component Builders file and go to the Compiler and to Joomla 3, then scroll down and there is the 'checkboxes' option and there is the 'Field list', the 'Field radio' [00:05:08](https://www.youtube.com/watch?v=91iIAuHZj38&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h05m08s) and the 'Field user' but the field user we actually made a whole custom field to just target the field user but the 'checkboxes' and the 'radio'. If you go back to JCB and create new and select 'Custom' you would see that it at some point asks; what would you like to extend? [00:05:41](https://www.youtube.com/watch?v=91iIAuHZj38&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h05m41s) And here is these three options you can extend that as a **List**, as a **Radio button** or **Checkboxes**. That is what this **'Extend'** is for. So that is currently the only 3 that is ready to go in JCB. There are of course others but then we will have to expand JCB. It doesn't reach those yet. If you are using a form list which is the most common one because you wanted have a list of things in [00:06:20](https://www.youtube.com/watch?v=91iIAuHZj38&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h06m20s) another table then you to populate the `getoptions` function.
[00:04:45](https://www.youtube.com/watch?v=91iIAuHZj38&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h04m45s)
To know what is all the available extending options we go to Joomla Component Builders file and go to the Compiler and to Joomla 3, then scroll down and there is the 'checkboxes' option and there is the 'Field list', the 'Field radio' [00:05:08](https://www.youtube.com/watch?v=91iIAuHZj38&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h05m08s) and the 'Field user' but the field user we actually made a whole custom field to just target the field user but the 'checkboxes' and the 'radio'. If you go back to JCB and create new and select 'Custom' you would see that it at some point asks; what would you like to extend? [00:05:41](https://www.youtube.com/watch?v=91iIAuHZj38&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h05m41s) And here is these three options you can extend that as a **List**, as a **Radio button** or **Checkboxes**. That is what this **'Extend'** is for. So that is currently the only 3 that is ready to go in JCB. There are of course others but then we will have to expand JCB. It doesn't reach those yet. If you are using a form list which is the most common one because you wanted have a list of things in another table then you to populate the `getoptions` function.
### Code required for Get Option funtion
[00:06:27](https://www.youtube.com/watch?v=91iIAuHZj38&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h06m27s)
The `getoptions` function or method is requiring this chunk of code. Now instead of making it that you need to write out this whole thing. [00:06:45](https://www.youtube.com/watch?v=91iIAuHZj38&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMREs&t=00h06m45s) In JCB you are just adding this part for the 'List'and this for the 'radio'. It's also just the `getoptions` for the 'Checkboxes' again also just `getoptions`. So it is basically the only code we need to have it's only with the user one [00:07:08](https://www.youtube.com/watch?v=91iIAuHZj38&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h07m08s) which we have a `getgroups` and `getexclude`. And if you select 'Custom user', that is exactly what you get, you get 'getexclude' area and you get 'getgroup' area and these two chunks of code is what is going to be placed [00:07:36](https://www.youtube.com/watch?v=91iIAuHZj38&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h07m36s) in this area here. That is what is going to happen. So you could at any time come in here and fiddle around with this, I mean in the PHP when the file is created. Like over here, I've got this 'Preacher' open. You can come in here and fiddle with us and then take your changes just back to the view to JCB and just place it in a Custom. That means that the type is movable because it is new but it must be something that doesn't already exist in Joomla. And if you don't know what all the field types are that exist in Joomla then a good place to start is to go to field types and check out all these and if that is still not clear you can go to this URL. This has a list of all Joomla's field types so you could [00:08:43](https://www.youtube.com/watch?v=91iIAuHZj38&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h08m43s) open that, scroll down and here is a list of all the field type names that you can't use again. It will be conflicting because it will break that name in that form. Do not use names that are not used by Joomla. Going back to creating a Custom Field. [00:09:12](https://www.youtube.com/watch?v=91iIAuHZj38&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h09m12s) We could start with Sermon Preacher which is the one we are looking at. So again the name up here is just for the interface for you, it's just that you can see what is the field. You can call this anything. It only fall back to this name if there isn't a label set here, then it will fall back to this name. [00:09:39](https://www.youtube.com/watch?v=91iIAuHZj38&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h09m39s) But the ideal is just set the label you know.