Updated 010 Component Settings (markdown)

Amigo 2019-07-15 16:45:44 +02:00
parent 3bd8e8982e
commit 956190eaee

@ -18,6 +18,8 @@ I'm including a bunch of things in files which means that I'm including the 'Com
### Adding Custom Admin Views
[00:04:54](https://www.youtube.com/watch?v=V2WkTjNFjvo&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h04m54s)
This custom admin menu is what I use to the map the compiler menu. I want to call it compiler. (The code is compiler.) I'm not using a link, because it's not another extension or website. Now I would select an icon. Here is the information. (See video.) [00:05:17](https://www.youtube.com/watch?v=V2WkTjNFjvo&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h05m17s) It's the same kind of switches as there was adding a back end admin view. You can tweak whether it should be an admin menu, a dashboard, or a submenu. We are placing it before component, so we select 'select before what admin view this one should be placed'. This means that it can go at the top. [00:05:49](https://www.youtube.com/watch?v=V2WkTjNFjvo&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h05m49s)
Custom files and folders that you have created by hand and are importing into your component when you compile it. The same is done with the compiler of component builder. I'm including it as files. [00:06:16](https://www.youtube.com/watch?v=V2WkTjNFjvo&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h06m16s) There is the compiler. (See video.) I took all the compiler files and placed them into the folder called compiler. It's a folder which moves all the files at once.
@ -26,31 +28,45 @@ Here is a folder with a lot of content in it. (See video.) [00:06:48](https://ww
### Adding Custom Config Fields
The area called config deals with something quite useful. It is to set up your back end global fields. [00:07:42](https://www.youtube.com/watch?v=V2WkTjNFjvo&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h07m42s) Go to sermon distributor, 'settings,' and 'config'. There is a long list of things. If we go to the actual component, you will see that it has many tabs. [00:08:25](https://www.youtube.com/watch?v=V2WkTjNFjvo&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h08m25s)
[00:07:27](https://www.youtube.com/watch?v=V2WkTjNFjvo&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h07m27s)
The area called config deals with something quite useful. It is to set up your back end global fields. Go to sermon distributor, 'settings,' and 'config'. There is a long list of things. If we go to the actual component, you will see that it has many tabs. [00:08:25](https://www.youtube.com/watch?v=V2WkTjNFjvo&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h08m25s)
### Custom Switches Using Sermon Component
[00:08:34](https://www.youtube.com/watch?v=V2WkTjNFjvo&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h08m34s)
All of these switches are done in the config area, except some of the defaults which is added by the simple switches. For example the global timer of which we spoke about the check-in. Here you can set it all; whether it should be every 5 hours, 12 hours, once a day, every second day, once a week, or never. It checks in your items automatically. The version control buttons are added automatically as well. That means the person can set the version control 'on' or 'off' and the number of records that should be set. [00:09:07](https://www.youtube.com/watch?v=V2WkTjNFjvo&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h09m07s) If 'zero', all versions will be saved.
### Adding Contributors
The author areas are also added automatically. When you click in the 'component,' you will see a 'contributing area'. [00:09:40](https://www.youtube.com/watch?v=V2WkTjNFjvo&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h09m40s) You can set whether you want to add 'empty contributor fields'. Here you can add as many contributors as you like; for instance those involved with developing your component and the amount of empty ones you want to leave there. Its also tweakable. That will add this area here. (See video.) [00:10:09](https://www.youtube.com/watch?v=V2WkTjNFjvo&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h10m09s) When you use this switch it controls whether it's will show in the back or the front, etc. They are added automatically, as is the permissional structure.
[00:09:21](https://www.youtube.com/watch?v=V2WkTjNFjvo&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h09m21s)
The author areas are also added automatically. When you click in the 'component,' you will see a 'contributing area'. You can set whether you want to add 'empty contributor fields'. Here you can add as many contributors as you like; for instance those involved with developing your component and the amount of empty ones you want to leave there. Its also tweakable. That will add this area here. (See video.) [00:10:09](https://www.youtube.com/watch?v=V2WkTjNFjvo&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h10m09s) When you use this switch it controls whether it's will show in the back or the front, etc. They are added automatically, as is the permissional structure.
### Adding UIkit
In the component you can set it to include UIKit. [00:10:37](https://www.youtube.com/watch?v=V2WkTjNFjvo&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h10m37s) It will automatically add this feature to your component and every where UIkit is used.
[00:10:33](https://www.youtube.com/watch?v=V2WkTjNFjvo&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h10m33s)
In the component you can set it to include UIKit. It will automatically add this feature to your component and every where UIkit is used.
### Adding Fields To Custom Config Fields
To add fields to the config area, you need to add the field to fields. [00:11:07](https://www.youtube.com/watch?v=V2WkTjNFjvo&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h11m07s) Go to fields; whatever field you want to use you need to create here. (See video.) Now you need to remember the system name that you're using so that when you open up this you would be able to type in the name and it will be selected. By convention as long as you use the same tab name it will be bundled in the order of which you set it here. [00:11:40](https://www.youtube.com/watch?v=V2WkTjNFjvo&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h11m40s) It is in the Dropbox area where all their fields are being set. The reason why we include this demo component into the application with the tutorial is that you can see that he's using 'Dropbox update method' here. [00:12:00](https://www.youtube.com/watch?v=V2WkTjNFjvo&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h12m00s) You can go look at this file. If you click it, it starts an update. [00:12:23](https://www.youtube.com/watch?v=V2WkTjNFjvo&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h12m23s) It' There is some 'global' like, 'local folder', 'download link'.s not that simple to do that because we are not inside of our component, we are in the config component in the global if you have global settings. [00:12:56](https://www.youtube.com/watch?v=V2WkTjNFjvo&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h12m56s) You can look at these things in this list view. All the Dropbox information is there. (See video.)
[00:11:06](https://www.youtube.com/watch?v=V2WkTjNFjvo&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h11m06s)
To add fields to the config area, you need to add the field to fields. Go to fields; whatever field you want to use you need to create here. (See video.) Now you need to remember the system name that you're using so that when you open up this you would be able to type in the name and it will be selected. By convention as long as you use the same tab name it will be bundled in the order of which you set it here. [00:11:40](https://www.youtube.com/watch?v=V2WkTjNFjvo&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h11m40s) It is in the Dropbox area where all their fields are being set. The reason why we include this demo component into the application with the tutorial is that you can see that he's using 'Dropbox update method' here. [00:12:00](https://www.youtube.com/watch?v=V2WkTjNFjvo&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h12m00s) You can go look at this file. If you click it, it starts an update. [00:12:23](https://www.youtube.com/watch?v=V2WkTjNFjvo&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h12m23s) It' There is some 'global' like, 'local folder', 'download link'.s not that simple to do that because we are not inside of our component, we are in the config component in the global if you have global settings. [00:12:56](https://www.youtube.com/watch?v=V2WkTjNFjvo&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h12m56s) You can look at these things in this list view. All the Dropbox information is there. (See video.)
### Spacer HR Field In Component Fields
'Spacer HR.' [00:13:24](https://www.youtube.com/watch?v=V2WkTjNFjvo&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h13m24s) You'd see 'spacer hr' quite often. It's a field that will be included in the paid version of component builder. It has 'spacer hr' in it, since you can use the same spacer over and over. The system automatically increment it, so that it doesn't have conflict in name conventions. Putting spacers which is this little line. (See video.) [00:14:01](https://www.youtube.com/watch?v=V2WkTjNFjvo&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h14m01s) It's very small but gives a space between these areas. You can also place default values which will be used during installation of the component. If you have switches in your config that you want to populate with default values, you should add those values here. [00:14:27](https://www.youtube.com/watch?v=V2WkTjNFjvo&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h14m27s) During the install, those values will be added to the database and component builder puts it in place for you. This is where you add the config fields. (See video.) [00:14:51](https://www.youtube.com/watch?v=V2WkTjNFjvo&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h14m51s)
[00:13:24](https://www.youtube.com/watch?v=V2WkTjNFjvo&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h13m24s)
'Spacer HR.' You'd see 'spacer hr' quite often. It's a field that will be included in the paid version of component builder. It has 'spacer hr' in it, since you can use the same spacer over and over. The system automatically increment it, so that it doesn't have conflict in name conventions. Putting spacers which is this little line. (See video.) [00:14:01](https://www.youtube.com/watch?v=V2WkTjNFjvo&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h14m01s) It's very small but gives a space between these areas. You can also place default values which will be used during installation of the component. If you have switches in your config that you want to populate with default values, you should add those values here. [00:14:27](https://www.youtube.com/watch?v=V2WkTjNFjvo&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h14m27s) During the install, those values will be added to the database and component builder puts it in place for you. This is where you add the config fields. (See video.) [00:14:51](https://www.youtube.com/watch?v=V2WkTjNFjvo&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h14m51s)
### Tab - View Names Fields added to Site Menu
I added a convention that isn't that obvious. If you use a tab name, which is the same as a front end view, then it will add this field to that front end views menu. [00:15:13](https://www.youtube.com/watch?v=V2WkTjNFjvo&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h15m13s) Joomla's Content Manager does the same thing. In the global setting of your article manager you can set features for categories and articles, but if you create a new article in a menu item, you can use 'global' or overwrite them.
[00:14:55](https://www.youtube.com/watch?v=V2WkTjNFjvo&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h14m55s)
I added a convention that isn't that obvious. If you use a tab name, which is the same as a front end view, then it will add this field to that front end views menu. Joomla's Content Manager does the same thing. In the global setting of your article manager you can set features for categories and articles, but if you create a new article in a menu item, you can use 'global' or overwrite them.
The feature of using the same tab name is 'preacher/ switch' whether it should be a table or a grid. [00:15:48](https://www.youtube.com/watch?v=V2WkTjNFjvo&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h15m48s) We set the default 2, and called it preachers plural. That is quite important. Let's look at the front. There is a bunch of menus. [00:16:09](https://www.youtube.com/watch?v=V2WkTjNFjvo&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h16m09s) Go to a menu that I've already created called 'preachers' then go to the components back end called 'preachers'. You see there is a list of items. I added the name 'preacher' as a tab name in the component builder.
@ -60,15 +76,21 @@ The system of adding these extra features to every item view of the front end is
### Site View Explanation Of Above Tabs
[00:19:57](https://www.youtube.com/watch?v=V2WkTjNFjvo&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h19m57s)
At the front of this component, if the view 'Preachers' is opened you will see an extra file called 'Default XML' in the template. Open 'default XML'. Now Component Builder adds the convention to this file. [00:20:18](https://www.youtube.com/watch?v=V2WkTjNFjvo&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h20m18s) (If it's not working as you expected, this is the file in which you look to see what is wrong. In the specific view that you have, it must be this view and the tab name in the file called 'default XML.') (See video). [00:20:41](https://www.youtube.com/watch?v=V2WkTjNFjvo&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h20m41s)
### Quick Explanation Of Creating Site Views
[00:20:45](https://www.youtube.com/watch?v=V2WkTjNFjvo&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h20m45s)
Since we haven't dealt with adding site views I will quickly explain it here so that you at least know something that relates to this. If you didn't click on 'add' as a menu, set it to 'no,' and the file will not exist. It only exist if this is set to 'yes'. [00:21:11](https://www.youtube.com/watch?v=V2WkTjNFjvo&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h21m11s) Setting it to 'yes' tells component builder to build this default XML file, and setting the tabs to the same name as this view tells component builder to add those fields to this field. It will create it so that your user can have unique implementation. This is important. [00:21:34](https://www.youtube.com/watch?v=V2WkTjNFjvo&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h21m34s) It doesn't make use of this information necessarily inside of your site view. You need to make use of this information in your site view.
### Using Of Parameters
If you're a developer you would know that inside of your component, you have a place where you can check the params header. [00:21:56](https://www.youtube.com/watch?v=V2WkTjNFjvo&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h21m56s) The parameters are set inside of the 'view.html.php'. Here we set the parameters. (See video). This gets all the parameters in relation to this view. It gets the component parameters and the menu parameters, and, if global had been used, automatically fall back on what is set here. [00:22:33](https://www.youtube.com/watch?v=V2WkTjNFjvo&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h22m33s) So you're using the same name, display and display; if you are using global parameters gets this parameter. [00:23:02](https://www.youtube.com/watch?v=V2WkTjNFjvo&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h23m02s) The display field is getting that parameter. It looks at the 'menus settings,' set to global, and it automatically falls back to the global settings. This means that by using params and doing a check-up this value is inside of 'this params. [00:23:34](https://www.youtube.com/watch?v=V2WkTjNFjvo&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h23m34s) Go to the default view; 'preacher display'. That's the field name in the global configurations. (See video.) [00:24:03](https://www.youtube.com/watch?v=V2WkTjNFjvo&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h24m03s) If I were to go and open this field you'd see the list of the 'switch preachers' fields in the fields tab. [00:24:37](https://www.youtube.com/watch?v=V2WkTjNFjvo&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h24m37s) Open that specific field and see that the name of this field is 'preachers_display'. [00:24:56](https://www.youtube.com/watch?v=V2WkTjNFjvo&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h24m56s) It is quite important that none of the fields have the same name. Every field in this global area must be unique.
[00:21:50](https://www.youtube.com/watch?v=V2WkTjNFjvo&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h21m50s)
If you're a developer you would know that inside of your component, you have a place where you can check the params header. The parameters are set inside of the 'view.html.php'. Here we set the parameters. (See video). This gets all the parameters in relation to this view. It gets the component parameters and the menu parameters, and, if global had been used, automatically fall back on what is set here. [00:22:33](https://www.youtube.com/watch?v=V2WkTjNFjvo&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h22m33s) So you're using the same name, display and display; if you are using global parameters gets this parameter. [00:23:02](https://www.youtube.com/watch?v=V2WkTjNFjvo&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h23m02s) The display field is getting that parameter. It looks at the 'menus settings,' set to global, and it automatically falls back to the global settings. This means that by using params and doing a check-up this value is inside of 'this params. [00:23:34](https://www.youtube.com/watch?v=V2WkTjNFjvo&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h23m34s) Go to the default view; 'preacher display'. That's the field name in the global configurations. (See video.) [00:24:03](https://www.youtube.com/watch?v=V2WkTjNFjvo&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h24m03s) If I were to go and open this field you'd see the list of the 'switch preachers' fields in the fields tab. [00:24:37](https://www.youtube.com/watch?v=V2WkTjNFjvo&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h24m37s) Open that specific field and see that the name of this field is 'preachers_display'. [00:24:56](https://www.youtube.com/watch?v=V2WkTjNFjvo&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h24m56s) It is quite important that none of the fields have the same name. Every field in this global area must be unique.
If you are a developer, always keep the concepts of conventions logical, repetitive and scalable. Here is one that I have added for instance. In the global area go to 'preachers'. It is this field here, 'Display - Table - Grid - List' and in the code, if preacher_display = 1, then show the table. [00:25:59](https://www.youtube.com/watch?v=V2WkTjNFjvo&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h25m59s) If preacher_display = 2, then show the grid. If non is selected then show the list. [00:26:21](https://www.youtube.com/watch?v=V2WkTjNFjvo&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h26m21s) I'm not asking does the global have this or that, I'm just calling the field directly, because Joomla gets that initial data and sorts it out for you. I've tested it and made sure that my explanation is correct. The same goes when it comes to 'colors'. (See video.) [00:26:55](https://www.youtube.com/watch?v=V2WkTjNFjvo&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h26m55s) Component builder makes it easy to implement these kind of things which otherwise would take time to write and then make sure it's the same inside of the XML folder menu, etc. Component Builder does all of this out of the config file with a convention that relates to the actual front end. [00:27:26](https://www.youtube.com/watch?v=V2WkTjNFjvo&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h27m26s)