diff --git a/038-Setup-Site-Edit-View-in-JCB.md b/038-Setup-Site-Edit-View-in-JCB.md index 6896db6..5691faa 100644 --- a/038-Setup-Site-Edit-View-in-JCB.md +++ b/038-Setup-Site-Edit-View-in-JCB.md @@ -10,24 +10,24 @@ How to add an Admin View to the front end of your site. There can be editing and [00:01:50](https://www.youtube.com/watch?v=tmB22d9dQ4M&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h01m50s) -How to add a editing area, (these three tabs to the front end of the site) that it will function like a form. Who will be allowed to access the form will depend upon the permissions structure. The permission structure controls who can edit and who can add items to a specific Admin view. [00:02:14](https://www.youtube.com/watch?v=tmB22d9dQ4M&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h02m14s) Currently the public cannot edit this, if an item is created they cannot edit it. There is an item level on permissions. If it is closed then it can be seen there is also a 'Global' control on permissions in 'Options'. The Global control of permissions is also, if you want public to be able to submit to this form, it is necessary to allow them to be able to create.[00:02:46](https://www.youtube.com/watch?v=tmB22d9dQ4M&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h02m46s) Set it to 'Allow', and the public is allowed to create. Most components has more than one view. This one has only one; it is called 'Look'. Over here('Look create') say allow, and if you want them to edit existing submissions. [00:03:13](https://www.youtube.com/watch?v=tmB22d9dQ4M&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h03m13s)There is the 'Edit state', 'Edit own', 'Created by', all these things in the global spec, as well as in the local edit of the view. <<<<<< +How to add a editing area, (these three tabs to the front end of the site) that it will function like a form. Who will be allowed to access the form will depend upon the permissions structure. The permission structure controls who can edit and who can add items to a specific Admin view. [00:02:14](https://www.youtube.com/watch?v=tmB22d9dQ4M&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h02m14s) Currently the public cannot edit this, if an item is created they cannot edit it. There is an item level on permissions. If it is closed then it can be seen there is also a 'Global' control on permissions in 'Options'. The Global control of permissions is also, if you want public to be able to submit to this form, it is necessary to allow them to be able to create.[00:02:46](https://www.youtube.com/watch?v=tmB22d9dQ4M&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h02m46s) Set it to 'Allow', and the public is allowed to create. Most components has more than one view. This one has only one; it is called 'Look'. Over here('Look create') say allow, and if you want them to edit existing submissions. [00:03:13](https://www.youtube.com/watch?v=tmB22d9dQ4M&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h03m13s)There is the 'Edit state', 'Edit own', 'Created by', all these things in the global spec, as well as in the local edit of the view. ### Two Switches [00:03:30](https://www.youtube.com/watch?v=tmB22d9dQ4M&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h03m30s) -There are two switches. One is a global switch, and one that is specifically focusing on the view. If the view cannot be accessed on the front end after it has been created, it is necessary to come back to this area and sort out the permissions for the specific group who should have access to the specific view on a front end. [00:03:57](https://www.youtube.com/watch?v=tmB22d9dQ4M&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h03m57s) This permission structure is quite intense and extendable. Specific groups can be targeted with specific permissions for every view that JCB builds in the Admin as well as in the Site views. Cancel out, no further changes will be done and it returns to the demo component. +There are two switches. One is a global switch, and one that is specifically focusing on the view. If the view cannot be accessed on the front end after it has been created, it is necessary to come back to this area and sort out the permissions for the specific group who should have access to the specific view on a front end. [00:03:57](https://www.youtube.com/watch?v=tmB22d9dQ4M&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h03m57s) This permission structure is quite intense and extendable. Specific groups can be targeted with specific permissions for every view that JCB builds in the Admin as well as in the Site views. Cancel out, no further changes will be done and it returns to the Demo Component. ### Demo Component - Settings [00:04:21](https://www.youtube.com/watch?v=tmB22d9dQ4M&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h04m21s) -In JCB there is a switch that can be flipped for JCB to write the code for the site end of this component.<<<<<<<<<<<<< - - [00:04:34](https://www.youtube.com/watch?v=tmB22d9dQ4M&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h04m34s)So I'm going back to JCB. Going to components and opening the component. And now in the component there is an area called settings where all your admin views are linked. I'm going to open that. Usually there are this little bug in Joomla, which if you open it the first time, it doesn't reflect the original setting. I usually open it, cancel it, and then open it again. You'll see that the original setting is [00:05:17](https://www.youtube.com/watch?v=tmB22d9dQ4M&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h05m17s) back. You will see that edit create site view must be set to yes. If it is set to yes, then it means that it's going to create a site view of view - look, as so that you can edit it on the site end and not only in the Admin area and it also means create items. Save this [00:05:44](https://www.youtube.com/watch?v=tmB22d9dQ4M&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h05m44s) and then also save and close. Go back to compiler, compile demo. Install it. +In JCB there is a switch that can be flipped for JCB to write the code for the site end of this component. So go back to JCB and to components and open the component. In the component there is an area called 'Settings' where all the admin views are linked. If that is opened, it may be seen that there is usually this bug in Joomla, which if it is opened for first time does not reflect the original setting. I usually open it, cancel it, and then open it again and the original setting is back.[00:05:17](https://www.youtube.com/watch?v=tmB22d9dQ4M&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h05m17s) You will see that 'Edit/Create Site View' must be set to 'Yes'. If it is set to 'Yes', then it means that it is going to create a Site View of this 'Look', so that it can be editted on the site end and not only in the Admin area and it also means Create items. Save this and then also save and close. Go back to compiler, compile demo. Install it. ### Code - Controller - Model - View +[00:06:05](https://www.youtube.com/watch?v=tmB22d9dQ4M&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h06m05s)<<<<<<< + Now let's go look at the code. Looking at the demo websites folder structure, we are going to components. We'll see that there is a com_demo folder. [00:06:19](https://www.youtube.com/watch?v=tmB22d9dQ4M&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h06m19s) We will see there is the models as well as the controllers as well as the views. This is the view that was dynamically generated by JCB. The view, the model and the controller are called look. You can open (controller look.php) to see what was the code that was written. [00:06:49](https://www.youtube.com/watch?v=tmB22d9dQ4M&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h06m49s) You can see it looks very similar to the admin area except that it's been slightly modified for your front end and it's requirements. As you can see we were adding some CSS classes and JavaScript from the back end. Here is the model, [00:07:16](https://www.youtube.com/watch?v=tmB22d9dQ4M&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h07m16s) getItem, getForm, and the controller. We are showing you the code what was created. The fact that this was created, doesn't mean that there is a set of links that you can click and edit the forms which was submitted or that there is a link to create any. These things is what you need to do manually. [00:07:51](https://www.youtube.com/watch?v=tmB22d9dQ4M&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h07m51s) authores