16 009 Adding Admin Views to a Component
Amigo edited this page 2019-08-15 17:25:19 +02:00

ADDING ADMIN VIEWS TO A COMPONENT

00:00:00 (Click on these time links to see Youtube video)

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 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.

Sermon Component Setting as Example

00:01:05

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.

Adding Views Setting Icons

00:01:39

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 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.

Settings Switch Admin Menu

00:02:29

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 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

00:03:04

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

Settings Switch Submenu

00:03:41

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

00:03:57

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 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 You can add auto check-in to a view by either saying 'yes' or 'no'.

Settings Switch Keep History

00:05:06

Keeping a 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

If I go 00:05:33 to preacher open 'A Capella Music' you'd see the 'version' button at the top. I type in Info@vdm.io, set 'Some text here' and click 'save'. If I click on 'version', you'll see that it now locked a new version. 00:06:13 I could take the one I'm on currently and keep it. It would lock it in because you can also set the amount of history the system should keep. The default changes. I can click on the previous version and say restore and it will be restored it. As you can see, Email address and description are gone. To go back to the one that has been done just click on 'version' and 'restore' and the details are back again. 00:06:52 History Component is a Joomla extension which you're able to integrate into your own components as a component developer. 00:07:14

Settings Switch MetaData

00:14:23

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 in making a page search engine optimized. If you do your homework and do things right in relation to the implementation of your metadata, you'd see that it adds good features to do the front end of your site. 00:14:51 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

Settings Switch Access

00:15:37

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

00:16:38

When you want to add to the 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 with import/export. If you export this, you'd see how to do an import; if it's is nice you can map the headers to their specific database tables. 00:17:13 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 work without any problem. 00:18:07 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

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 creates 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 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 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 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 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

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 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 the area. 00:22:00 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 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 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.

This is the back end of the dummy company that I've set up. 00:23:42 You can see that it moved it to the front. Not only did it make it possible to edit data, but also to create new companies. If you click on 'create company' you will see that it opens up in an area for you to start fresh. You can create a company from scratch. In this example, you will see that it cannot add a user. If you click Save, the system (through some custom scripting that I've added) adds his ID here. (See video.) He doesn't need to select it.

That was a quick look at that button called edit create site view. 00:24:19 It adds the whole codebase to the front and integrates it to the way that the front needs to be able to control the permissions.

The order of the items is the way it will be displayed anywhere. For example, the order in which all of this is done (how the icons are laid out even if you opened one of them; for the submenu, etc.) is controlled by this order number here. (See video.) 00:24:48

I hope this tutorial was insightful. If you have any questions you're welcome to send me an email.