Updated 007 Admin Views (markdown)

Amigo 2019-05-24 12:01:38 +02:00
parent 9806c9d14a
commit 477a1cd257

@ -37,23 +37,23 @@ One of the features that makes Component Builder far more advanced than other co
**Tabs** **Tabs**
We will definitely be speaking about this permissional structure as we go along the tab structure if you look at these we call them tabs [00:19:27](https://www.youtube.com/watch?v=CdSKSCTzmRA&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h19m27s) settings fields CSS JavaScript PHP MySQL Publishing and Permissions. The tab structure. We call these tabs. (See video.) [00:19:27](https://www.youtube.com/watch?v=CdSKSCTzmRA&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h19m27s)
**Tabs - Default - Publishing - Permissions** * **Publishing and Permissions: Example of What Tabs Can Be**
The publishing permissions are tabs that are built automatically for all back end admin views. [00:19:43](https://www.youtube.com/watch?v=CdSKSCTzmRA&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h19m43s) Old admin views have this permission and well the permission only if if set and published will always be there in published we basically bundle your the fields that are built dynamically without you having to set them I think that is what you could say [00:20:09](https://www.youtube.com/watch?v=CdSKSCTzmRA&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h20m09s) with publishing all those fields that you do not need to set are always placed in publishing and so everything else this MySQL tab here the PHP JavaScript CSS Fields and settings are actually an example of what tabs can be. 'Publishing' and 'Permissions' are tabs that are built automatically for all back end admin views. [00:19:43](https://www.youtube.com/watch?v=CdSKSCTzmRA&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h19m43s) All admin views have 'Permissions' (only if set) and 'Publishing.' In 'Publishing' we bundle the fields that are built dynamically, without you having to set them. [00:20:09](https://www.youtube.com/watch?v=CdSKSCTzmRA&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h20m09s) All the fields that you do not need to set are always placed in 'Publishing.'
**Tabs - Preacher example** * **Example: Preacher**
Now in preacher I actually setup two tabs one called [00:20:32](https://www.youtube.com/watch?v=CdSKSCTzmRA&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h20m32s) details and one called sermons. So there are two tabs in preachers so that means if you were to open the preacher back end view. First one would be called settings the second one will be called sermons. Then you'd see publishing and permission. So that's how it would look. In 'Preacher' I set up two tabs: one called 'Details' and one called 'Sermons.' [00:20:32](https://www.youtube.com/watch?v=CdSKSCTzmRA&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h20m32s) So there are two tabs in 'Preacher' which means that if you were to open the 'Preacher' back end view the first one would be called settings and the second one will be called sermons. You'd also then see 'Publishing' and 'Permissions' at the end.
**Tabs - Fields Linking(Preacher)** * **Fields Linking**
Now when you create fields [00:20:53](https://www.youtube.com/watch?v=CdSKSCTzmRA&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h20m53s) you would see that there is a column here called tab, and you then will select the number. Now the tabs are number from one to whatever. We don't start at zero although that might have made more sense for programmers we started with one. So first tab, second tab, and because we are using [00:21:15](https://www.youtube.com/watch?v=CdSKSCTzmRA&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h21m15s) a place different from the tabs. We don't use the names. So you need to remember that this is tab one, this is tab two. So when you set up a field you need to tell us in which tab you want to place that field. So that is what this tab number here is all about. [00:21:35](https://www.youtube.com/watch?v=CdSKSCTzmRA&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h21m35s) Now you might say but where is tab two's information because they are sermons right. Well because of the fact that sermons is an actually a table on its own. If we go out here we will see that there is a admin view called sermon, and it has its own back end view, [00:22:02](https://www.youtube.com/watch?v=CdSKSCTzmRA&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h22m02s) and it has its own structure. So how can I get the sermons that is only related to this preacher to be showing in the second tab called sermons? Well we created a thing called linked views. Now when you create fields [00:20:53](https://www.youtube.com/watch?v=CdSKSCTzmRA&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h20m53s) you would see that there is a column here called tab, and you then will select the number. Now the tabs are number from one to whatever. We don't start at zero although that might have made more sense for programmers we started with one. So first tab, second tab, and because we are using [00:21:15](https://www.youtube.com/watch?v=CdSKSCTzmRA&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h21m15s) a place different from the tabs. We don't use the names. So you need to remember that this is tab one, this is tab two. So when you set up a field you need to tell us in which tab you want to place that field. So that is what this tab number here is all about. [00:21:35](https://www.youtube.com/watch?v=CdSKSCTzmRA&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h21m35s) Now you might say but where is tab two's information because they are sermons right. Well because of the fact that sermons is an actually a table on its own. If we go out here we will see that there is a admin view called sermon, and it has its own back end view, [00:22:02](https://www.youtube.com/watch?v=CdSKSCTzmRA&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h22m02s) and it has its own structure. So how can I get the sermons that is only related to this preacher to be showing in the second tab called sermons? Well we created a thing called linked views.
**Tabs - Fields Linked Views(Sermon)** * **Fields Linked Views**
Now linked views is the place where this is done. [00:22:25](https://www.youtube.com/watch?v=CdSKSCTzmRA&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h22m25s) So basically I selected sermon as the view, I said it should be placed in the second tab, and in child key, is preacher. So if I think about sermons which is the child, sermon is the child, preacher is the parent. So you would always think of the parent as this the view in which you are the moment you are setting up the linked [00:22:49](https://www.youtube.com/watch?v=CdSKSCTzmRA&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h22m49s) view. So that if you are in preacher the parent is preacher, if you are in sermons, the parent is sermon. So depends on which view you are busy editing. And so here when we talk about the child key, this would be the database field name [00:23:10](https://www.youtube.com/watch?v=CdSKSCTzmRA&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h23m10s) that is to be looked at, and the parent field name, that should be found inside of preachers. So when we look at preachers you would let's go back to sermon. We got sermon open here and if I open this fields, Well I don't need to open it here in fact let me use another place. [00:23:38](https://www.youtube.com/watch?v=CdSKSCTzmRA&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h23m38s) It is easier to see. Now linked views is the place where this is done. [00:22:25](https://www.youtube.com/watch?v=CdSKSCTzmRA&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h22m25s) So basically I selected sermon as the view, I said it should be placed in the second tab, and in child key, is preacher. So if I think about sermons which is the child, sermon is the child, preacher is the parent. So you would always think of the parent as this the view in whic Then you'd see publishing and permission. So that's how it would look.h you are the moment you are setting up the linked [00:22:49](https://www.youtube.com/watch?v=CdSKSCTzmRA&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h22m49s) view. So that if you are in preacher the parent is preacher, if you are in sermons, the parent is sermon. So depends on which view you are busy editing. And so here when we talk about the child key, this would be the database field name [00:23:10](https://www.youtube.com/watch?v=CdSKSCTzmRA&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h23m10s) that is to be looked at, and the parent field name, that should be found inside of preachers. So when we look at preachers you would let's go back to sermon. We got sermon open here and if I open this fields, Well I don't need to open it here in fact let me use another place. [00:23:38](https://www.youtube.com/watch?v=CdSKSCTzmRA&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h23m38s) It is easier to see.
Let's go to fields you will see that there is a field called name. There is a field called preacher. This is the field that we want [00:24:10](https://www.youtube.com/watch?v=CdSKSCTzmRA&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h24m10s) connected to with each other right. So to get the sermons that belongs to that preacher, we need to get the ID of this field. Now that is a custom field. And we said that we are going to look at custom fields only after explaining the admin views. So I'm going to go into detail now but I'm going to open that field none the less and I'm going to show you that its name is preacher. [00:24:35](https://www.youtube.com/watch?v=CdSKSCTzmRA&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h24m35s) And because that field will be connected to sermon it means that in the database the ID which is the key field is going to be saved in preacher. So that means the ID of the preacher is saved inside of the preacher column, in the database. [00:24:55](https://www.youtube.com/watch?v=CdSKSCTzmRA&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h24m55s) Now let me show you that in the database itself, so here in the database with sermon distributor and I'm opening sermons and you would see that we would scroll until we see preacher. And it has ID's in it and those are the IDs of the preacher's themselves. So if I was to go to preacher, it basically means that we are linking [00:25:24](https://www.youtube.com/watch?v=CdSKSCTzmRA&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h25m24s) to this ID here. So going back to our linked view concept, that means the child database table, in which the ID of this preacher must be found is in preacher. [00:25:43](https://www.youtube.com/watch?v=CdSKSCTzmRA&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h25m43s) The parent key would be this preachers ID and so by doing that, the linked view will only show the sermons that are related to this specific preacher. And that is how the linked views can be linked. If you didn't select these correctly, it won't load all of them [00:26:05](https://www.youtube.com/watch?v=CdSKSCTzmRA&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h26m05s) It won't work well. So there needs to be that tight relationship between the parent and the child view. So there is also a way to actually link from an array so let's say [00:26:23](https://www.youtube.com/watch?v=CdSKSCTzmRA&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h26m23s) the person is able to select more than one preacher, there is a way for you to also type that, but that would all be dealt with in advanced concepts. I could explain some of it here but let me show you that would be one of the syntax(>) to use [00:26:48](https://www.youtube.com/watch?v=CdSKSCTzmRA&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h26m48s) But like I said I think possibly I need to deal with this in advanced concepts because who will know to look for the answer in this video or tutorial. So we'll stay with the basics here. So the basic way of linking another view would be to select that view from this drop down. Then say in which tab it should display. Then [00:27:12](https://www.youtube.com/watch?v=CdSKSCTzmRA&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h27m12s) what is the child database table in which to look, what is the parents value to use to build a relationship. And then this add new button yes or no, is basically when you look at fields here, you see it has a 'new' button. [00:27:38](https://www.youtube.com/watch?v=CdSKSCTzmRA&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h27m38s) So you can in that switch (add new button) decide whether it should show it or not. I should tell you that if you say yes and you have in that view created the correct permissional of structure for whether somebody can create an item you can control the display of that 'new" button [00:28:02](https://www.youtube.com/watch?v=CdSKSCTzmRA&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h28m02s) with just setting the permission of that users specific group. So if that user isn't in a group that doesn't have permissions to create new items, for in this example, for preachers or for sermons, then that 'new' button will also not show up. So we have that permissional wrapped around that button's display methods. [00:28:26](https://www.youtube.com/watch?v=CdSKSCTzmRA&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h28m26s) Let's go to fields you will see that there is a field called name. There is a field called preacher. This is the field that we want [00:24:10](https://www.youtube.com/watch?v=CdSKSCTzmRA&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h24m10s) connected to with each other right. So to get the sermons that belongs to that preacher, we need to get the ID of this field. Now that is a custom field. And we said that we are going to look at custom fields only after explaining the admin views. So I'm going to go into detail now but I'm going to open that field none the less and I'm going to show you that its name is preacher. [00:24:35](https://www.youtube.com/watch?v=CdSKSCTzmRA&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h24m35s) And because that field will be connected to sermon it means that in the database the ID which is the key field is going to be saved in preacher. So that means the ID of the preacher is saved inside of the preacher column, in the database. [00:24:55](https://www.youtube.com/watch?v=CdSKSCTzmRA&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h24m55s) Now let me show you that in the database itself, so here in the database with sermon distributor and I'm opening sermons and you would see that we would scroll until we see preacher. And it has ID's in it and those are the IDs of the preacher's themselves. So if I was to go to preacher, it basically means that we are linking [00:25:24](https://www.youtube.com/watch?v=CdSKSCTzmRA&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h25m24s) to this ID here. So going back to our linked view concept, that means the child database table, in which the ID of this preacher must be found is in preacher. [00:25:43](https://www.youtube.com/watch?v=CdSKSCTzmRA&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h25m43s) The parent key would be this preachers ID and so by doing that, the linked view will only show the sermons that are related to this specific preacher. And that is how the linked views can be linked. If you didn't select these correctly, it won't load all of them [00:26:05](https://www.youtube.com/watch?v=CdSKSCTzmRA&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h26m05s) It won't work well. So there needs to be that tight relationship between the parent and the child view. So there is also a way to actually link from an array so let's say [00:26:23](https://www.youtube.com/watch?v=CdSKSCTzmRA&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h26m23s) the person is able to select more than one preacher, there is a way for you to also type that, but that would all be dealt with in advanced concepts. I could explain some of it here but let me show you that would be one of the syntax(>) to use [00:26:48](https://www.youtube.com/watch?v=CdSKSCTzmRA&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h26m48s) But like I said I think possibly I need to deal with this in advanced concepts because who will know to look for the answer in this video or tutorial. So we'll stay with the basics here. So the basic way of linking another view would be to select that view from this drop down. Then say in which tab it should display. Then [00:27:12](https://www.youtube.com/watch?v=CdSKSCTzmRA&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h27m12s) what is the child database table in which to look, what is the parents value to use to build a relationship. And then this add new button yes or no, is basically when you look at fields here, you see it has a 'new' button. [00:27:38](https://www.youtube.com/watch?v=CdSKSCTzmRA&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h27m38s) So you can in that switch (add new button) decide whether it should show it or not. I should tell you that if you say yes and you have in that view created the correct permissional of structure for whether somebody can create an item you can control the display of that 'new" button [00:28:02](https://www.youtube.com/watch?v=CdSKSCTzmRA&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h28m02s) with just setting the permission of that users specific group. So if that user isn't in a group that doesn't have permissions to create new items, for in this example, for preachers or for sermons, then that 'new' button will also not show up. So we have that permissional wrapped around that button's display methods. [00:28:26](https://www.youtube.com/watch?v=CdSKSCTzmRA&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h28m26s)