Updated 009 Adding Admin Views to a Component (markdown)

Amigo 2019-07-15 16:29:22 +02:00
parent 775ee17d59
commit ca4d9cb5bc

@ -1,33 +1,49 @@
# ADDING ADMIN VIEWS TO A COMPONENT
[00:00:00](https://www.youtube.com/watch?v=39vY66X7GGU&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h00m00s)
We've looked at setting up admin views and creating fields for admin views. We've looked at setting up field types and how to use field types to create fields. Now we'll look at setting the admin views to the component and all that can be done to the component. [00:00:28](https://www.youtube.com/watch?v=39vY66X7GGU&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h00m28s) First we will look at adding the admin views to a component. Go to components, sermon distributor, and settings. There you will see admin views. [00:00:59](https://www.youtube.com/watch?v=39vY66X7GGU&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h00m59s)
### Sermon Component Setting as Example
[00:01:05](https://www.youtube.com/watch?v=39vY66X7GGU&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h01m05s)
To connect admin views to your component go to settings and open this button here. (See video.) Select an option and click 'next'. Do the next one. If you have a lot of admin views, type in the name of the admin view. [00:01:33](https://www.youtube.com/watch?v=39vY66X7GGU&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h01m33s)
### Adding Views Setting Icons
[00:01:39](https://www.youtube.com/watch?v=39vY66X7GGU&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h01m39s)
Type in the name 'Sermon'. These icons here which have been mentioned previously, are the icons from Joomla called Joomla Standard Icomoon Fonts. (See video.) [00:02:02](https://www.youtube.com/watch?v=39vY66X7GGU&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h02m02s) If you select an icon here, 'Joomla', it will show you that icon (see video) but only during the selection face. That is the icon that is going to be used for the view in the right. Look at the icon (top right) as we click through component builder; it gets updated. [00:02:24](https://www.youtube.com/watch?v=39vY66X7GGU&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h02m24s)
### Settings Switch Admin Menu
[00:02:29](https://www.youtube.com/watch?v=39vY66X7GGU&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h02m29s)
This icon is what is being set here. (See video.) You can select the icons to reflect the admin view of your choice. We have a bunch of switches here that we'll look at one at a time. 'Admin menu' is the menu. [00:02:49](https://www.youtube.com/watch?v=39vY66X7GGU&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h02m49s) Do you want that view to show up next to your main view? That will be the first tick box, yes.
### Settings Switch Dashboard Items
Do you want to have an 'add record' icon for this view? If you go to the dashboard it is this icon 'Add Admin View'. [00:03:10](https://www.youtube.com/watch?v=39vY66X7GGU&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h03m10s) It is a shortcut to create an admin view from the dashboard. Say 'yes' and a 'Dashboard (list of records)' icon will show. If you don't want this 'Admin View' icon, just add 'admin view' and tick that 'Dashboard(add record)' as 'no'. [00:03:35](https://www.youtube.com/watch?v=39vY66X7GGU&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h03m35s)
[00:03:04](https://www.youtube.com/watch?v=39vY66X7GGU&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h03m04s)
Do you want to have an 'add record' icon for this view? If you go to the dashboard it is this icon 'Add Admin View'. It is a shortcut to create an admin view from the dashboard. Say 'yes' and a 'Dashboard (list of records)' icon will show. If you don't want this 'Admin View' icon, just add 'admin view' and tick that 'Dashboard(add record)' as 'no'. [00:03:35](https://www.youtube.com/watch?v=39vY66X7GGU&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h03m35s)
### Settings Switch Submenu
[00:03:41](https://www.youtube.com/watch?v=39vY66X7GGU&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h03m41s)
If you've opened your view it has a submenu here that can collapse away. You can add this view to the submenu or not.
### Settings Switch Auto Check-in
Auto check-in is a tweak that I've added to my Joomla components. (I'm possibly going to make a pull request to add it to Joomla.) [00:03:59](https://www.youtube.com/watch?v=39vY66X7GGU&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h03m59s) Auto check-in adds a feature to your component. [00:04:28](https://www.youtube.com/watch?v=39vY66X7GGU&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h04m28s) It checks whether this item had been checked out longer than a set period; if it happened to be so, it checks it automatically. The set period is something that the administrator sets in the global settings of the component. [00:04:57](https://www.youtube.com/watch?v=39vY66X7GGU&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h04m57s) You can add auto check-in to a view by either saying 'yes' or 'no'.
[00:03:57](https://www.youtube.com/watch?v=39vY66X7GGU&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h03m57s)
Auto check-in is a tweak that I've added to my Joomla components. (I'm possibly going to make a pull request to add it to Joomla.) Auto check-in adds a feature to your component. [00:04:28](https://www.youtube.com/watch?v=39vY66X7GGU&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h04m28s) It checks whether this item had been checked out longer than a set period; if it happened to be so, it checks it automatically. The set period is something that the administrator sets in the global settings of the component. [00:04:57](https://www.youtube.com/watch?v=39vY66X7GGU&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h04m57s) You can add auto check-in to a view by either saying 'yes' or 'no'.
### Settings Switch Keep History
[00:05:06](https://www.youtube.com/watch?v=39vY66X7GGU&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h05m06s)
Keeping history of a back end view. The History Component is one of the most exciting things that I have integrated. It keeps track of every change you make in any article or item in your application.
* Example
@ -36,18 +52,26 @@ If I go [00:05:33](https://www.youtube.com/watch?v=39vY66X7GGU&list=PLQRGFI8XZ_w
### Settings Switch MetaData
Depending on whether you are going to use the views information on the front end as your main base for your page, you might want to add metadata. [00:14:23](https://www.youtube.com/watch?v=39vY66X7GGU&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h14m23s) Although Google and others may be ignoring it and metadata isn't that useful anymore, it still plays a role making a page search engine optimized. If you do your homework and do things right in relationship to implementation of your metadata, you'd see that it adds good features to do the front end of your site. [00:14:51](https://www.youtube.com/watch?v=39vY66X7GGU&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h14m51s) I'd suggest that you add metadata when you use a specific area to the front. (You'll be remodeling the data because you can get relationships from many databases. You need the area in the back end to get the data.) [00:15:26](https://www.youtube.com/watch?v=39vY66X7GGU&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h15m26s)
[00:14:23](https://www.youtube.com/watch?v=39vY66X7GGU&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h14m23s)
Depending on whether you are going to use the views information on the front end as your main base for your page, you might want to add metadata. Although Google and others may be ignoring it and metadata isn't that useful anymore, it still plays a role making a page search engine optimized. If you do your homework and do things right in relationship to implementation of your metadata, you'd see that it adds good features to do the front end of your site. [00:14:51](https://www.youtube.com/watch?v=39vY66X7GGU&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h14m51s) I'd suggest that you add metadata when you use a specific area to the front. (You'll be remodeling the data because you can get relationships from many databases. You need the area in the back end to get the data.) [00:15:26](https://www.youtube.com/watch?v=39vY66X7GGU&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h15m26s)
### Settings Switch Access
This access switch adds the following feature: if you open an article, and open publishing, it says 'dropdown', 'access public' etc. Those are relating to your user access levels. [00:15:52](https://www.youtube.com/watch?v=39vY66X7GGU&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h15m52s) As you know, user access levels can target multiple groups into one user access level. This is a feature that will be useful when you look at the front end of your component though you can also make use of it in the back end. You can change the access of a specific item but since we also have such intense permissional switches, I hardly ever make use of it.
[00:15:37](https://www.youtube.com/watch?v=39vY66X7GGU&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h15m37s)
This access switch adds the following feature: if you open an article, and open publishing, it says 'dropdown', 'access public' etc. Those are relating to your user access levels. As you know, user access levels can target multiple groups into one user access level. This is a feature that will be useful when you look at the front end of your component though you can also make use of it in the back end. You can change the access of a specific item but since we also have such intense permissional switches, I hardly ever make use of it.
### Settings Switch Export/Import
When you want to add to import/export function. [00:16:38](https://www.youtube.com/watch?v=39vY66X7GGU&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h16m38s) This is an extended area which component builder dynamically adds. You don't need to do anything in relation to scripting at this stage. You could click 'yes' or 'no' to import/export feature at the top of the page of every view. Every view will have an import/export function. It's a direct relationship import/export. If you export this, you'd see how to do a import; if it's is nice you can map the headers to their specific database tables. [00:17:13](https://www.youtube.com/watch?v=39vY66X7GGU&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h17m13s) Work is needed, especially when you're dealing with information that was encrypted. If you export it, it will decrypt it if you have the permissions to access that item, but the problem is that it had been decrypted when you imported it, so it doesn't know that it should encrypt it. There is a discrepancy with the advance storing methods. As long as you are having a data back end database table that doesn't require these advance storing methods, it's normal defaults like I explained before. Then the import/export method will works without any problem. [00:18:07](https://www.youtube.com/watch?v=39vY66X7GGU&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h18m07s) The switch here is 'Export/Import data.' If you don't like the feature just click 'no'.
[00:16:38](https://www.youtube.com/watch?v=39vY66X7GGU&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h16m38s)
When you want to add to import/export function. This is an extended area which component builder dynamically adds. You don't need to do anything in relation to scripting at this stage. You could click 'yes' or 'no' to import/export feature at the top of the page of every view. Every view will have an import/export function. It's a direct relationship import/export. If you export this, you'd see how to do a import; if it's is nice you can map the headers to their specific database tables. [00:17:13](https://www.youtube.com/watch?v=39vY66X7GGU&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h17m13s) Work is needed, especially when you're dealing with information that was encrypted. If you export it, it will decrypt it if you have the permissions to access that item, but the problem is that it had been decrypted when you imported it, so it doesn't know that it should encrypt it. There is a discrepancy with the advance storing methods. As long as you are having a data back end database table that doesn't require these advance storing methods, it's normal defaults like I explained before. Then the import/export method will works without any problem. [00:18:07](https://www.youtube.com/watch?v=39vY66X7GGU&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h18m07s) The switch here is 'Export/Import data.' If you don't like the feature just click 'no'.
### Settings Switch Edit - Create - Site Views
[00:18:20](https://www.youtube.com/watch?v=39vY66X7GGU&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h18m20s)
Every back end view has an edit area. If you've selected the read/write option in the edit area you can change the values of that back end listview. The admin create site view means that the system will dynamically build the front area which you then can access to edit the data at the front of the website. [00:18:42](https://www.youtube.com/watch?v=39vY66X7GGU&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h18m42s) It's an excellent tool. For example, it takes this editing area and places it on the front of your website. (See video.) [00:19:13](https://www.youtube.com/watch?v=39vY66X7GGU&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h19m13s) In the permissional structures you can control who is editing this, etc. (We looked at adding the fields to your admin views; you could set whether this field should have permissional structure.) It means that if you have those things set up back in the global permissional tab, it will be implemented in the front. [00:19:44](https://www.youtube.com/watch?v=39vY66X7GGU&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h19m44s) If the user is in the incorrect group he won't be able to access this. Nor, for example, update the modified date or the status in the front. You have control over who can do what but at the same time you have the ability to edit items on the front. [00:20:19](https://www.youtube.com/watch?v=39vY66X7GGU&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h20m19s) However, the fact that it creates the view and places it on the front doesn't mean that there is a link somewhere to it. That is something you need to add to your site front custom site as you develop it. Therefore, if you don't know PHP and if you're not familiar with setting up your links on the front of the component, you would possibly find this feature difficult to implement. [00:20:54](https://www.youtube.com/watch?v=39vY66X7GGU&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h20m54s)
Let's look at what it can build. I have a component in which I'm using the feature quite a lot. It's called 'costbenefitprojection'. In the back end we look at the views, where we have here one called 'company' and one called 'scaling' factor and 'intervention'. These are 'editing views' and 'list views'. Go to the front of the website, open the component, click on view, and you will see company, intervention and scaling factors. [00:21:28](https://www.youtube.com/watch?v=39vY66X7GGU&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h21m28s) They are being extended here. The component builder adds this view and the module for it. The controller for it was also added. The script is placed in area. [00:22:00](https://www.youtube.com/watch?v=39vY66X7GGU&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h22m00s) For example, we'll look at this component inside the area called 'cpanel'. (This is some dummy data that I placed in here.) Here you can open multiple items. You can click on 'edit advanced profile' and it will open the editing area. [00:22:37](https://www.youtube.com/watch?v=39vY66X7GGU&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h22m37s) This is the front end editing area; (as you can see there are all the tabs.) Here's the back end area. The same information in the front shows up here, only dumping the permission and publishing features. The Access permissions were done automatically because the front-end user didn't have permissions to edit most of the things here. [00:23:10](https://www.youtube.com/watch?v=39vY66X7GGU&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h23m10s) You didn't have the right to edit any of these, therefore the system removed the tab. The same goes with the permissions. If you didn't have the right to do scaling factors on interventions, you have dumped it; it won't show it up in the front.