Updated 044 Hello World Component with Joomla Component Builder Creator Extended (markdown)

Amigo 2019-08-16 08:28:12 +02:00
parent 42f074839b
commit 1289cdb5d2
1 changed files with 21 additions and 21 deletions

@ -219,45 +219,45 @@ The Auto Check-in feature. When a record is created that is stored in the Databa
[00:38:10](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h38m10s)
The other great feature is this 'Keeping of History' to keep track of all the changes made to any item of Greeting. Simply tick this 'Keep History' and JCB will dynamically add all the needed structures and Joomla's [00:38:30](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h38m30s) Integrated History Component will work alongside your third-party Component and keep track of every item and its changes. That is just a tick box and JCB does the work. <<<<<<
The other great feature is this 'Keeping of History' to keep track of all the changes made to any item of Greeting. Simply tick this 'Keep History' and JCB will dynamically add all the needed structures and Joomla's [00:38:30](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h38m30s) Integrated History Component will work alongside your third-party Component and keep track of every item and its changes. That is just a tick box and JCB does the work.
### Has Metadata Adds Metadata Fields To The View
[00:38:43](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h38m43s)
The Has Metadata adds the metadata Fields to the view. You don't need to add them, it gets added just by ticking this box.
The 'Has Metadata' adds the metadata Fields to the view. You do not need to add them, it gets added just by ticking the box in the 'Has Metadata' column.
### Add Access
[00:38:55](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h38m55s)
Then also does this View have Access, Public Special or Registered all these Access levels. Do you want to implement these levels of access on this view? Usually you would use this if you want the view to be editable on the front end of the Site, because then you will use the Access to control some of these. I'll show you more of that as we go along. I'll just click this as yes. I wanted to have an import function. And like we said we want to 'Add a Site Edit and Create View for this Admin View'. Yes. [00:39:38](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h39m38s) We want it to be first in Order. This Admin View is going to have all the features that an Admin View can have by Default in JCB. As you would realize when we start demonstrating it, although it's as easy as ticking this box, the code that JCB is going to write to do this implementation, is quite stable, and yet dynamic that as Joomla evolves and changes, we can tweak these codes [00:40:09](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h40m09s) in the Compiler and make sure that it remains stable this way. Save and close. Now that we have linked this Admin View to the Component, we can go to Admin Views and we'll see Admin View. We'll even see the Icon. We can click on this little pencil and it will take us to the Admin View. Again making sure that all your work is being saved in this area, click Okay if it is, and you'll see that it opens the Admin View where we linked the Fields [00:40:48](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h40m48s) and we can work in the Admin View from the Component. There are areas in the Admin View I didn't demonstrate. Like the Permissions, the Tabs, the Linked Views. I'm not going to do much of that.
This View has an Access function, here all these Access levels can be set which are Public, Special or Registered. Do you want to implement these levels of access to this view? Usually, this is used if you want the view to be editable on the front end of the Site because then you will use the Access to control some of these. More of that as we continue. If you need an Import/Export function, tick it accordingly and likewise do if we want to add an Edit/Create Site View for this Admin View. [00:39:38](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h39m38s) If we want it to be first, then set it in the 'Order' column. This Admin View has all the features that an Admin View can have by Default in JCB. The code that JCB is going to write to do this implementation, is quite stable, and yet dynamic, that as Joomla evolves and changes, we can tweak these codes in the Compiler and make sure that it remains stable this way. [00:40:15](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h40m15s) Save and close. Now that this Admin View has been linked to the Component, we can go to Admin Views and see this Admin View as well the Icon. Click on this pencil and it will take you to the Admin View. Make sure that all your work has been saved in this area, click OK, if it is, and it opens the Admin View where we linked the Fields. [00:40:48](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h40m48s) and You can work in the Admin View from the Component. <<<<
### Adding Permissions
[00:41:03](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h41m03s)
I'm just going to add some Permissions, because I want to demonstrate the Permission Structure regarding the front end Management of Editing these items. I'm just going to use the Core. There is the option of using what is known as the view.edit [00:41:22](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h41m22s) instead of core.edit then it means its relationship is just for this view. If I want it to be related to the Core which means that it's not going to be only related to this view, but whatever I change in the Core will affect this view. For more explanation on the permissions there is this tutorial which is available in the Description. You can go watch this tutorial and also maybe do some changes. Compile the Component and look at the code. [00:41:54](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h41m54s) Look at the code and look at the code. That's all I can say for most questions being asked because the code really tells you what has been done. There are many ways for you to learn how JCB does things by making changes and then compiling your component and looking at what changed. Usually using something like Git will be very useful in discovering the changes. There's also a way for you to know where in the Compiler specific code is being created which I will show you as we continue.
I'm just going to add some Permissions because I want to demonstrate the Permission Structure regarding the front end Management of Editing these items. I'm just going to use the Core. There is the option of using what is known as the view.edit [00:41:22](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h41m22s) instead of core.edit then it means its relationship is just for this view. If I want it to be related to the Core which means that it's not going to be only related to this view, but whatever I change in the Core will affect this view. For more explanation on the permissions, there is this tutorial which is available in the Description. You can go watch this tutorial and also maybe do some changes. Compile the Component and look at the code. [00:41:54](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h41m54s) Look at the code and look at the code. That's all I can say for most questions being asked because the code really tells you what has been done. There are many ways for you to learn how JCB does things by making changes and then compiling your component and looking at what changed. Usually using something like Git will be very useful in discovering the changes. There's also a way for you to know where in the Compiler specific code is being created which I will show you as we continue.
Since we've made changes, I'll simply click on save and close. [00:42:36](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h42m36s) This will take us back to the Component. Being back in the component, we'll see that everything is still the way we left it. There is quite a few things around the Admin View which I'm not going to go into depth during this tutorial. I would encourage you to watch the tutorials that are already online for actual explanation on all these features. [00:43:04](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h43m04s) But to demonstrating a Hello World Component we have done quite enough regarding the back end. All that now remains is to compile, so we'll click save and close and we'll go to the Compiler. Select our Component and Compile. That means we've just written 9000 lines of code, [00:43:36](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h43m36s) created 51 folders and 122 files. If we were to have manually written this without any boilerplate tool or wire script that could help us write all the classes and tables and stuff and it took us 5 seconds to write one line, it would have taken us 25 hours or about three 8 hour days. [00:44:07](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h44m07s) That's a long it would have taken you to do this manually. So just right there JCB has already saved you quite a lot of time.
Since we've made changes, I'll simply click on save and close. [00:42:36](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h42m36s) This will take us back to the Component. Being back in the component, we'll see that everything is still the way we left it. There are quite a few things around the Admin View which I'm not going to go into depth during this tutorial. I would encourage you to watch the tutorials that are already online for an actual explanation on all these features. [00:43:04](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h43m04s) But to demonstrating a Hello World Component we have done quite enough regarding the back end. All that now remains is to compile, so we'll click save and close and we'll go to the Compiler. Select our Component and Compile. That means we've just written 9000 lines of code, [00:43:36](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h43m36s) created 51 folders and 122 files. If we were to have manually written this without any boilerplate tool or wire script that could help us write all the classes and tables and stuff and it took us 5 seconds to write one line, it would have taken us 25 hours or about three 8 hour days. [00:44:07](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h44m07s) That's a long it would have taken you to do this manually. So just right there JCB has already saved you quite a lot of time.
### Installing The Component
[00:44:17](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h44m17s)
Now the Component can be installed by clicking this'install com_hello_world_v2_0_0_J3_on this Joomla Website Button or grabbing the URL and going to the normal installer. Because it has Compiled a Shippable Joomla Component Package which can be installed on any Joomla Website.
Now the Component can be installed by clicking this 'install com_hello_world_v2_0_0_J3_on this Joomla Website Button or grabbing the URL and going to the normal installer. Because it has Compiled a Shippable Joomla Component Package which can be installed on any Joomla Website.
### Select An Image
[00:44:42](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h44m42s)
Now one thing I didn't do it, I didn't select a Component image. When we selected you see there is no image showing as there is with this one. So I think I want to quickly go back, I'm going to clear the temporary folder and just go select [00:45:01](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h45m01s) at least the Demo Components Image as our Hello World Component. So in the Component there is this area to select an Image. I'm going to click select and I've selected the Demo Components Package so that we have something. I'm going to save and close again. Now go back to the Compiler and compile it again. I'm going to click on install. If I now go here we'll see that there is now a new Component in this Joomla Website. I'm going to open in a new Tab. [00:45:45](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h45m45s) There we go we got our Component installed. It has a Greetings Tab and a Add Greetings Tab. We also have not selected images for those. Let's quickly do that. Going back to the Admin Views and then the Greetings I'm going to click on Greetings first as an Admin View. Here you see there is a place for Icons and the Add Icon. [00:46:13](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h46m13s) I'm going to select Icon. So I've selected this little bucket as the icon for Greetings. I'm going to just add one for adding a Greeting with a little green plus. Now we got it to icons. I'm going to click save and close. I've got Greetings [00:46:39](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h46m39s) setup and I'm going to go and compile this again. That's usually how things go. We go make a change, we come back to the Compiler to compile it, install it and go look at the Component. When it gets a little bit more advanced, we not only go and look at the Component in Joomla [00:47:03](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h47m03s) but we also go and look at the code. There we got it, the two icons are in place. If I click Add Greeting, we see that there's the Name, there are the Greetings. There's also all these other fields added by default. So the created and the Metadata and the Permissions are all in place. That is how you would set up a basic Hello World Component.
Now one thing I didn't do it, I didn't select a Component image. When we selected you see there is no image showing as there is with this one. So I think I want to quickly go back, I'm going to clear the temporary folder and just go select [00:45:01](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h45m01s) at least the Demo Components Image as our Hello World Component. So in the Component, there is this area to select an Image. I'm going to click select and I've selected the Demo Components Package so that we have something. I'm going to save and close again. Now go back to the Compiler and compile it again. I'm going to click on install. If I now go here we'll see that there is now a new Component in this Joomla Website. I'm going to open in a new tab. [00:45:45](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h45m45s) There we go we got our Component installed. It has a Greetings Tab and an Add Greetings Tab. We also have not selected images for those. Let's quickly do that. Going back to the Admin Views and then the Greetings I'm going to click on Greetings first as an Admin View. Here you see there is a place for Icons and the Add Icon. [00:46:13](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h46m13s) I'm going to select Icon. So I've selected this little bucket as the icon for Greetings. I'm going to just add one for adding a Greeting with a little green plus. Now we got it to icons. I'm going to click save and close. I've got Greetings [00:46:39](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h46m39s) set up and I'm going to go and compile this again. That's usually how things go. We go make a change, we come back to the Compiler to compile it, install it and go look at the Component. When it gets a little bit more advanced, we not only go and look at the Component in Joomla [00:47:03](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h47m03s) but we also go and look at the code. There we got it, the two icons are in place. If I click Add Greeting, we see that there's the Name, there are the Greetings. There's also all these other fields added by default. So the created and the Metadata and the Permissions are all in place. That is how you would set up a basic Hello World Component.
### Hello World Configuration
[00:47:34](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h47m34s)
If we go to the options we will see that it has Check in timer and you can change it to 5 hours what I explained the checks in the items. We also have the history version enabled and set to remember 10 versions of any item created as a greeting. We also have the Permission structure in place which includes the Greeting [00:48:04](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h48m04s) Access, Greetings Batch Use, Dashboard Add and so forth which all the switches related to the greetings area.
If we go to the options we will see that it has Check-in timer and you can change it to 5 hours what I explained the checks in the items. We also have the history version enabled and set to remember 10 versions of any item created as a greeting. We also have the Permission structure in place which includes the Greeting [00:48:04](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h48m04s) Access, Greetings Batch Use, Dashboard Add and so forth which all the switches related to the greetings area.
### From the Front End to The Component - How To View, Edit, Add Greetings
@ -275,19 +275,19 @@ The first thing we need to do we need to create what is known as a Dynamic Get.
[00:50:05](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h50m05s)
In this area where we can see the full greeting, we are going to add an Edit button. And in the list area we are going to add a Create button. These Create and Edit buttons are going to be controlled by the Permissions structure which JCB puts into your Component by you just saying that it should be there. Setting up a Dynamic Get is quite easy.
In this area where we can see the full greeting, we are going to add an Edit button. And in the List area, we are going to add a Create button. These Create and Edit buttons are going to be controlled by the Permissions structure which JCB puts into your Component by you just saying that it should be there. Setting up a Dynamic Get is quite easy.
### First - Use Back-end View
[00:50:23](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h50m23s)
First know that I'm going to use a Back-end View which is related to my component. I'm going to select that Back-end View, you see it says Greetings(first). Like I said before with a system name is what is used in the drop downs. Here we select Greetings(first). This one(getType) is going to bring back a getlistQuery. We don't want any Pagination. I don't need all of this. We don't need [00:50:59](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h50m59s) the asset id. We can leave the created by and the created. We can take out the modified, the version we can also leave. The hits and the ordering that's fine. The greeting we most certainly don't need in a list, we only need the name. Let's give it a Name that we can sort of identify when we start setting up the site view. We call this List [00:51:35](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h51m35s) Greetings and in brackets (Name only) so that weArea will know this is what it is. Going to save that. You didn't need to save it.
First, know that I'm going to use a Back-end View which is related to my component. I'm going to select that Back-end View, you see it says Greetings(first). Like I said before with a system name is what is used in the dropdowns. Here we select Greetings(first). This one(getType) is going to bring back a getlistQuery. We don't want any Pagination. I don't need all of this. We don't need [00:50:59](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h50m59s) the asset id. We can leave the created by and the created. We can take out the modified, the version we can also leave. The hits and the ordering that's fine. The greeting we most certainly don't need in a list, we only need the name. Let's give it a Name that we can sort of identify when we start setting up the site view. We call this List [00:51:35](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h51m35s) Greetings and in brackets (Name only) so that weArea will know this is what it is. Going to save that. You didn't need to save it.
### Tweaking The Data Without Saving
[00:51:47](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h51m47s)
We could have just gone right into tweaking the data without saving. What the data tweak gives us is, it gives us a little bit of control on the writing that JCB will do regarding this query. For example we want it to be ordered. The ordering is called a.ordering. We want to order it ascending by the order set in the database.
We could have just gone right into tweaking the data without saving. What the data tweak gives us is, it gives us a little bit of control on the writing that JCB will do regarding this query. For example, we want it to be ordered. The ordering is called a.ordering. We want to order it ascending by the order set in the database.
### Filter To Add
@ -311,13 +311,13 @@ The next one is going to be Greeting. We want it to be one item. We going to do
[00:55:07](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h55m07s)
Please go and watch the tutorial on Dynamic Get on GitHub. There is a place, I just show you called Wiki. In the Wiki, there are links to all the different tutorials. You should really watch all of that. My encouragement is to really watch everything. I have often seen people ask the question [00:55:35](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h55m35s) in the issue area which are dealt with in the tutorials. I'm sorry we all have a lot of things to do and so if I don't answer this questions but simply point you to the tutorial I hope you understand.
Please go and watch the tutorial on Dynamic Get on GitHub. There is a place, I just show you called Wiki. In the Wiki, there are links to all the different tutorials. You should really watch all of that. My encouragement is to really watch everything. I have often seen people ask the question [00:55:35](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h55m35s) in the issue area which are dealt with in the tutorials. I'm sorry we all have a lot of things to do and so if I don't answer these questions but simply point you to the tutorial I hope you understand.
### Two Dynamic Gets Created - Second Return One Greeting
[00:55:52](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h55m52s)
We've got in the Dynamic Get all the value selected that we want and also how to limit it. The tweak is in place and the limiting factors. We don't need to join it to any other tables, we simply going to [00:56:09](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h56m09s) return these values. We could add the username values if we wanted. We wanted to show who created this. We could say created by, go to Joint, click on the Join Database Tables not Join View Tables because we want to use the user table and we want a single [00:56:46](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h56m46s) item returned and on Field it will be a.created_by and in the Joint Field it will be b.id and we want the username. We don't need the id, we already got that so just the user_name. We could just say [00:57:19](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h57m19s) greeted_by. He's the one sending the greeting. Save and close. Now we've got two Dynamic Gets, a listgreeting and a greeting. This is what you need to build first. Again starting at the Database looking at what is the data I want [00:57:54](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h57m54s) on the page? What do I want to show the people looking at the page? By that determining what the data is going to grab from the Database and giving it system names that are identifiable.
We've got in the Dynamic Get all the value selected that we want and also how to limit it. The tweak is in place and the limiting factors. We don't need to join it to any other tables, we simply going to [00:56:09](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h56m09s) return these values. We could add the username values if we wanted. We wanted to show who created this. We could say created by, go to Joint, click on the Join Database Tables not Join View Tables because we want to use the user table and we want a single [00:56:46](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h56m46s) item returned and on Field it will be a.created_by and in the Joint Field it will be b.id and we want the username. We don't need the id, we already got that so just the user_name. We could just say [00:57:19](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h57m19s) greeted_by. He's the one sending the greeting. Save and close. Now we've got two Dynamic Gets, a Listgreeting, and a greeting. This is what you need to build first. Again starting at the Database looking at what is the data I want [00:57:54](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h57m54s) on the page? What do I want to show the people looking at the page? By that determining what the data is going to grab from the Database and giving it system names that are identifiable.
### Next To Do - Create A Site View
@ -336,7 +336,7 @@ I'm going to build two Site Views. The first Site View we are going to call the
[00:58:55](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h58m55s)
A Code Name greetings. The Code Name is significant because you don't want to clash with Admin Views that you've already created that are going to be edit views on the front since the listview is not being placed on the front of your component only the edit view. That means edit views name is greeting. We can't set a Code Name for the front called greeting otherwise they will conflict. I'm just going to use greeting and for the single I'm going to use greet. [00:59:34](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h59m34s) Just give you a little explanation on why I'm doing things the way I'm doing it.
A Code Name greetings. The Code Name is significant because you don't want to clash with Admin Views that you've already created that are going to be edit views on the front since the listview is not being placed on the front of your component only the edit view. That means edit views name is greeting. We can't set a Code Name for the front called greeting otherwise they will conflict. I'm just going to use greeting and for the single, I'm going to use greet. [00:59:34](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h59m34s) Just give you a little explanation on why I'm doing things the way I'm doing it.
* ### Description, Snippet
@ -348,13 +348,13 @@ A little Description here Greetings. I'm going to just place a little heading an
[01:00:28](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=01h00m28s)
Now over here at Main Get, we are going to select the listgreetings(name only) and the reason why there are two of these, Main Get and Dynamic Get. One is what we will act upon in the compilation, the other one is just for you to look. So if you end up here(Looking) and click save, it will not be playing any role whatsoever in the compilation. It will play a role when you export a JCB Package but that's a whole different subject and I'm not going to deal with that. Good practice would be that these two Main Get and Dynamic Get are the same. Since you can add Custom Gets, we don't have any Custom Gets setup, so you can't select any, but you can add more than just [01:01:17](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=01h01m17s) your normal Main Get to a Site View. You can add the Main Get and then a bunch of Custom Gets which brings a whole ton of data to the page from different variations from relationships. I know it's a little bit beyond the Hello World Component. It is there and it does work very well. You will need to do some home work in tutorials and so forth.
Now over here at Main Get, we are going to select the Listgreetings(name only) and the reason why there are two of these, Main Get and Dynamic Get. One is what we will act upon in the compilation, the other one is just for you to look. So if you end up here(Looking) and click save, it will not be playing any role whatsoever in the compilation. It will play a role when you export a JCB Package but that's a whole different subject and I'm not going to deal with that. Good practice would be that these two Main Get and Dynamic Get are the same. Since you can add Custom Gets, we don't have any Custom Gets setup, so you can't select any, but you can add more than just [01:01:17](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=01h01m17s) your normal Main Get to a Site View. You can add the Main Get and then a bunch of Custom Gets which brings a whole ton of data to the page from different variations from relationships. I know it's a little bit beyond the Hello World Component. It is there and it does work very well. You will need to do some homework in tutorials and so forth.
* ### Listgreetings Gives Snippets
[01:01:42](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=01h01m42s)
We want the listgreetings and so this listgreetings gives us a few Snippets. Do know that the Snippets are not always accurate because it's very difficult for me to always know exactly how the implementation is going to work out. I'm giving you a snippet which is how I expect you to use the data. You can adjust that and this is where your knowledge of PHP will [01:02:10](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=01h02m10s) come into play. You should know what this and that little arrow items is because we are working with an object. You must know what it means? How to use an object? How to interact with an object? How to parse over it? How to grab its values? How to update its values? All this is part of your own background that you need to bring to JCB. JCB is not going to crank out customized Site Views the way it does the Admin Views. My idea was when it comes to Site Views I always want to do something different and I just want to have the ease of getting all the data on the page and then be creative. I haven't spent much time to make this as automatic, I want to setup of the back end and the Admin Views because this is what makes your component different from every other [01:03:15](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=01h03m15s) Component out there. We want to encourage you to do you do a lot of preparation and thinking about Data Structures in relationships because your Dynamic Get can grab from so many data places and bring all that data to you in a nice object which you can then parse and display with a lot of permission switches as I will show you in a moment. That is giving you little backdrop on why the Dynamic Get and the Site View even the Custom Admin View, it's relationship and why it is like that.
We want the Listgreetings and so this Listgreetings gives us a few Snippets. Do know that the Snippets are not always accurate because it's very difficult for me to always know exactly how the implementation is going to work out. I'm giving you a snippet which is how I expect you to use the data. You can adjust that and this is where your knowledge of PHP will [01:02:10](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=01h02m10s) come into play. You should know what this and that little arrow items is because we are working with an object. You must know what it means? How to use an object? How to interact with an object? How to parse over it? How to grab its values? How to update its values? All this is part of your own background that you need to bring to JCB. JCB is not going to crank out customized Site Views the way it does the Admin Views. My idea was when it comes to Site Views I always want to do something different and I just want to have the ease of getting all the data on the page and then be creative. I haven't spent much time to make this as automatic, I want to set up of the back end and the Admin Views because this is what makes your component different from every other [01:03:15](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=01h03m15s) Component out there. We want to encourage you to do you do a lot of preparation and thinking about Data Structures in relationships because your Dynamic Get can grab from so many data places and bring all that data to you in a nice object which you can then parse and display with a lot of permission switches as I will show you in a moment. That is giving you a little backdrop on why the Dynamic Get and the Site View even the Custom Admin View, it's relationship and why it is like that.
* ### Looping Through Items
@ -366,23 +366,23 @@ Basically looping through those items is this these two strings and is all we ne
[01:05:18](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=01h05m18s)
Now we going to go back to our Component and we are going to add the Site View to it. You might ask why don't we just add the Component to the Site View when we create the Site View? That was a idea that I did play with. But because of Database relationships and all kinds of reasons I felt that the better approach would be to link Site Views at the Component area instead of at the Site area. This gives us the option to use Site Views quite easily with in other Components. That was really the idea behind it We might rethink this and we might reshuffle this in the future. I mean this is the first time I build such a Component called JCB. Who knows what happens if we start refactoring it in a more Advancement program is get involved. It might become even far better than it is now. [01:06:20](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=01h06m20s) This is how it works at the moment.
Now we going to go back to our Component and we are going to add the Site View to it. You might ask why don't we just add the Component to the Site View when we create the Site View? That was an idea that I did play with. But because of Database relationships and all kinds of reasons I felt that the better approach would be to link Site Views at the Component area instead of at the Site area. This gives us the option to use Site Views quite easily within other Components. That was really the idea behind it We might rethink this and we might reshuffle this in the future. I mean this is the first time I build such a Component called JCB. Who knows what happens if we start refactoring it in a more Advancement program is get involved. It might become even far better than it is now. [01:06:20](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=01h06m20s) This is how it works at the moment.
### Creating A Site View
[01:06:23](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=01h06m23s)
So you go to Site Views and click Create Linked Site Views. Then you select that Greeting Site View. You say yes I want to be able to Add Menu to the front of my website with this view. I want this view to use Has Metadata. It is going to be this Component Default View. I wanted to control Access. We will look at that again, but I want that Access that its default be Public. This is again making use of all the options and save and close.
So you go to Site Views and click Create Linked Site Views. Then you select that Greeting Site View. You say yes I want to be able to Add Menu to the front of my website with this view. I want this view to use Has Metadata. It is going to be this Component Default View. I wanted to control Access. We will look at that again, but I want that Access that its default is Public. This is again making use of all the options and save and close.
### Compiling The Component*
[01:07:09](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=01h07m09s)
If we go back to compiling our Component there's no changes being done to the Database.
If we go back to compiling our Component there are no changes being done to the Database.
* ### Heads Up - When Updating Your Component It Automatically Updates The Database
I need to give you a heads up here. If you're adding new tables, JCB is build to know that and add the tables to a Sequel Update. Which when you update the Component, it automatically updates the Database. But it's still important for you to check that it does this. For there could be a reason that it thinks that it's not necessary. Yet I tried to build enough places, things in place so that it will pick up that you've added [01:08:05](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=01h08m05s) either a field or a new view to the Component and that the Component now needs to increment a version and release a table update. But sometimes that is not happening and then if you update your Component, the Database is not being updated necessarily. So that's just something you need to keep your finger on, make sure that it happens. For most part JCB will take care of that. Since this upgrade we have only added a front end. We haven't touch the Database, everything about that, it cis just the way it was before.
I need to give you a heads up here. If you're adding new tables, JCB is build to know that and add the tables to a Sequel Update. Which when you update the Component, it automatically updates the Database. But it's still important for you to check that it does this. For there could be a reason that it thinks that it's not necessary. Yet I tried to build enough places, things in place so that it will pick up that you've added [01:08:05](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=01h08m05s) either a field or a new view to the Component and that the Component now needs to increment a version and release a table update. But sometimes that is not happening and then if you update your Component, the Database is not being updated necessarily. So that's just something you need to keep your finger on, make sure that it happens. For the most part, JCB will take care of that. Since this upgrade, we have only added a front end. We haven't touched the Database, everything about that, it is just the way it was before.
### Compiling The Component(continue)*
@ -398,7 +398,7 @@ Just a heads up. When you add a front end Site View and you set that to default
[01:09:53](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=01h09m53s)
Before you can add the Greetings to a Site Menu. We've got at least four Greetings in place. We can add that list view to an Front and Site view. We go to Menus and go to Main Menu. Select Menu type. Click Hello World Greetings that was the previous Component. We've got Greeting set as the HOME of this website. We going to click save and close. [01:10:54](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=01h10m54s) There we go. We've got HOME and Hello World Greetings. That should mean that if we click on this preview(demonstration button) the front end of the Site, we should see the Greetings. It's going to say 'The page isn't redirecting properly'.
Before you can add the Greetings to a Site Menu. We've got at least four Greetings in place. We can add that list view to an Front and Site view. We go to Menus and go to Main Menu. Select the Menu type. Click Hello World Greetings that was the previous Component. We've got Greeting set as the HOME of this website. We going to click save and close. [01:10:54](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=01h10m54s) There we go. We've got HOME and Hello World Greetings. That should mean that if we click on this preview(demonstration button) the front end of the Site, we should see the Greetings. It's going to say 'The page isn't redirecting properly'.
### Set Front Site View To Have Access Control