Skip to content

009 Adding Admin Views to a Component

eweyn edited this page Dec 19, 2018 · 16 revisions

Hi Reef Lock that setting up admin views with group that Creating fields for admin views Bluetooth setting up fuel types and how to use fuel types to create fields Now we would like to look at Setting the admin views to the component Obviously the component itself has so much things that you can do I'm gonna try and Deal with it No airtime So I'm first gonna just look at adding The Admin views to a component Ok so You go to components And will go to 7 distributor And you would go to settings Yeah you'd see Admin views To connect admin views to your component you need to go to settings and open this button Usually when you start to look like this So very straight forward Have a drop down here And you make a selection selection And then click next And you do the next one And if you have a lot of admin use Like I Do here You would Type in the name of the admin View And dairy Howick So I'm gonna type in the name here sermon Now these icons here I spoken about them previously They are the icons from Joomla Which is called I Just look Standard Icomoon font Ok so it's this This font here Now If you select a And I can't hear You show you that little icon with only during the selection face So That is the icon That is gonna be used For the view You're in the right I come there As we click through Component Builder It updates that I can't This icon Is what is being said here Now you can select the icons to Reflect Upward view of your choice Now we have a bunch of switches here and I'll look at them one at a time You have the menu Is basically this menu So the question is do you want that View to show up next to your main View I'll be the first Tick box So it's a yes Then Do you want to have an add record Icon For this review Icon if you go to the dashboard Is this This icon here Basically a shortcut to creating an admin View From the dashboard Song Will say yes Then A dashboard list of records icon So maybe you don't want this icon just Add new Then you can take that Again here we would like yes Then a submenu Number submenu if you've opened Your View that has a submenu year that can collapse away I just submenu You can add this view To the sub menu or not Then Water checking Is a Little tweak that I've added to to my Gmail or components and I'm possibly gonna Make a call request to add it to July it's self What How to check indoors Is it Absa feature to your component Since you see I have clients that complaint That some people will open an item And then in the browser click back instead of picking clothes And I will keep the item locked out Do that Individual And so others cannot access it unless they have admin rights to check it back in So we created an altar checking Now to check in check Whether this item has been checked out longer than a set period I never has been it takes it in automatically know that said period Is Something that the administrator sets in the global settings of the component I'll show you that later Just that you know You can add oil to check into a view By the saying yes or no here Been keeping history of a Back and view Now these three component I must tell you is maybe one of them most exciting things that I could integrate You see what it does is it keeps track of every change you make In any article or any item in your application So for example If I was to go to Let's just look at just a moment To a Preacher And I would open up this acapella music You see that it has that version button here the top Bye-bye was gonna make a change here let's say I typed in Infrared medium And I said Some text here And I clicked save And then I clicked on version You see that it's now locked a new version And there are the old ones And I could click on one of the old ones and click result First let me say I could take the one I'm on currently And I get say keep That would sort of lock it in because You can also set how long How long How long amount of History should the system keep The default is 10 then change is so I can click on the previous version and say restore And this will restore it and you see there Email address is gone and this description is gone If I want to go back to the one I turn I could just get three conversion again I think there and also restore And Now We would see wow The details are Back Again That is the feature of history that is actually extension Which You're able as a application to the component developer Integrate into your own Components And it's not that easy in fact it's maybe very Difficult If I was to show you the amount of product let me do that That you need to write First of all you need to add An asset ID to all your Backend view database tables So if we were to go to 7 distributor And check Front entrance go to the back in And we check out it's equal table You see that all of them have asset ideas Now That is Really not as easy as it is Once you've got the acid ID Then in your model When you basically save Sorry not in the model Table When you start your table you should set up observers The check baby The specific Item to add history options 2 Do that Acid ID So this is this is part of the whole Part of the script that is being added this is being added on the right place As well as in the store method There is another Tweakbit I My take too long to look at all of that Will go into more detail in the advanced courses I suppose But just let you know I create an import export method And even in the import and export of data actually Primarily in importing of data You need to again Do a pilot Vance trick to ensure that the history of that I can will still be tracked These kind of features I just added dynamically to your component because of that switch No that's not the only code the code that really throws people out I suppose Is this group code Script that is used When the component installs So if you look at this This is the uninstall error error in the script code Which runs when you uninstall the component and it's looking in many places it's looking in content-type it's Looking in the content Tag map Is looking in the ucm base Looking in the content types again and review I mean This is not just Once off Pittsburg you these checks are done and we are removing any items That might remain there Because when you uninstall a component What you don't realise Is it so integrated into the July system that just removing it's on tables actually doesn't do the job So we added the feature that if you uninstall it actually cleans the July system of that extension from Completely which is ideal because you won't want any traces left you you would like to uninstall something You want it gone And so this uninstall method does exactly that And then with the installing of this component Yeah which is the post Lite install We actually had Many records to Areas inside of Jamila so for example Inside of the letter C Add content type We we need to add this information And we have to do it for every view with your selected Hi the tags or History Will look at the tags in the category consequent Just a little bit Later Just to get a heads up and I realise this and not Take me to say we will look at that The new content types as you see we are adding it for the server Romans we adding it for the series says we're adding it for the sister sticks and for the help documents And that is when we install their component we are needed now You not seeing all picture let me scroll a bit look at that String that needs to be Written and Added to the database Of these specific areas To create that integration where it will track the object change and just do it automatically So all this is generated by component Builder And then when you do an update now you raise the issue When you do an update and you're adding a new Field Do I view This update will make sure that that specific field also will get tracked So what it first does Is it gets the data it tries to see whether it already exists if it exists Minutes here It just updated If it's been for some reason removed It inserts So that is the update method The update method also takes care of the little lot of discrepancies Because as you develop your extension now These two faces to development Do want phrases when you're busy building it and no one else in the world that has it That's very easy face in fact then you don't really use this nice feature You just uninstall it and reinstall it every time until you happy with what you see But then once you put it out in the public you can't just step up your database structure without the The needed scripting for others to do a easy upgrade Because they already got data in the database there can't just uninstall uninstall That's that's ridiculous No component builder has a way for you to actually dress that Well obviously because I have to deal with it and I don't wanna have my clients complain So I added a feature which will look at it inside of component Builders component the area Explain it in detail but just that you know this part of the update feature you making use You're a specific integration to keep track of your Back and view changes Two items isn't Place already Written by component Builders telling you here On which line it was done If you have that switch trip Ok so that is just giving you a quick glimpse into the crowd Of A little switch Sorry Level switch called Keep history So this weeks does all that for you for this specific View Then Depending on whether you gonna use this views information on the front end as your main base for you For your page you might wanna add Metadata The metadata is I know isn't that Use for anymore but you know what Go to Google and others are maybe ignoring it It still plays a role to making a page Very search engine optimised Component Builder If If you do your homework and you do things right In relationship to implementation of your metadata You see that it actually adds tremendous good features to Do your front end of your site So I would suggest that you add Metadata when you are gonna use a specific area to the front and when we start looking at us setting up the site Views You see this Coming up again and The necessity of using it Officially you'll be remodeling the data because you can get relationship from many databases but You need the area in the back in to get the data right Ok then this access switch Might throw you out This simply adds The following feature If you open an article in the open publish It says your access Publix Super registered Which is relating to your user I just close this New user access levels And as you know user actually will scan target multiple groups into one user access level I'm so this again is only a feature that will really be Extremely useful when you look at your front end of your component the back and you can also make use of it Of course You can change the access of a specific item but since we also have such intense permission Switches I hardly ever make use of it but it's there and I mostly use it for front end When I want a certain area in the front of sorry set an item not to be accessible to the front Ok then do you want to add to import export function again this is a Standard area which oven builder dynamically just adds so you don't need to do anything Scripting at this stage You could just click yes or no to import export Feature at the top of the page Of every View So every View Wanna have an import export at the moment it's a direct relationship import export what I mean by that Is You need to follow If you export this then you'd see the the way it should look to doing import And the import is really nice you can map their head is to their specific database tables Obviously there's work needed especially when you're dealing with Information that was encrypted if you export it it will decrypt it if you have the permission Two actions that item was but the problem is because it's decrypting When you imported it doesn't know that it should encrypted so there is a little discrepancy with the advance Storing methods so as long as you are having a data back in database table that at Actually doesn't require these advance storing methods it's just your normal defaults like me explain before the Import export more than works seemingly Without any problems I'm so I'm still working on this area but it's already working well enough that I felt I could leave it in there Ok that is the switch here and obviously if you don't like the future just know Then here is a feature which I think I'm most excited about And that is Every back in View As of course and edit area right if you've selected that Read write option then the edit area you can change the values of that back and listview So The admin create site View Means that the system Is gonna dynamically build The front Area Which you can access To edit the data at the front of the website Now Yahoo this is already whatever that's excellent tool So it takes exactly this if I was to use this and that sample Attacks This editing area and place it on the front Of your website Now obviously You are controlling in the promotional structures who has access to edit this with access to edit this The status was access to edit specific fields We looked at adding the fuels to your admin views and you could tick Whether this field should have conditional structure Now That means that If you have those things set up in the back in the Global professional tab Then it will be implemented in the Front if a certain user is in the in the correct group They won't be able to access this then if they have access but they don't have the right to for example update Maybe the modified date or The state is then in the front there also will not be able to do that so you have Immense control over who can do what But at the same time you have the ability to actually edit items on the front I think that is Excellent To be able to do that and they're all of that just possible by saying yes But Realise this The fact that it creates the The view if I could save her so And places it on the front Doesn't mean that there is a link somewhere to Earth That is something you need to add to your site front custom site As you develop it And this is partly a feature therefore which is you don't know PHP and if you're not that familiar with How to setup your links on the front of the component Impossibly would find this difficult to implement But I will show you What it builds in fact I can show you that now I have a component which I'm using that feature quite a lot And it's cold Cost-benefit projection this is the backend So if we look at the views we have your Ford company And we have One called Scaling factor and intervention Now these are editing views as you can see those other list views those are the editing views Nice I go to the front of them after the website Open that component Nikon View You see that there is company There is intervention and there is scaling factors Day Are basically being extended here So what two component build it as is it adds this view It also adds the module for it And I'm also adds the controller for it So basically I put all the script in place so that all you need to do is inside of for example I have your a An error occurred cpanel now let me show you this component briefly Ok so this is just some dummy data that I In here none of them is real And so here You can open multiple items This is all stuff that I built in component in fact none of this was built outside of component Golden It always done in component daughter And you can click on edit advance profile And it will open the editing area As you can see and now this is the back in editing area of that now let me show you sorry this is the front Editing area And as you can see there are older Tabs Now let me show you the back in Here's the back in the area So it's basically a showing up the same information in the front Is only dumps the permission and Publishing features But that is because of access permissions is done automatically Because that front-end user didn't have permissions to edit things In most of the things in here and f***** You don't have the right to edit any of these Therefore it didn't need to see it and so the system just remove that tab same goes with the permissions And if you didn't have the right to do scaling factors on interventions You also have dumped that it won't show it up In the front And so this is the back end of that same company That I've set up And you can see that it basically Moved it to the front Not only did it make it possible to edit data but also to create new companies So if you click on that You see it opens up in the area for you to start fresh so you can create a company from scratch Now In this specific example you see that you cannot actually add a user So what the system is done through some custom scripting that I've added If you click save without his ID here And he doesn't need to select that Ok so that's just a quick look at That specific button Called edit create site view and add the whole codebase to the front And integrates it to the Way that the front Needs to be able to control the permissions Then the order of of the items are Simply the way in which it will be displayed anywhere So if we think about the order From moment here Of Example component The order of which these I can't solve laid out and even if you opened one of them Order which this is done And also for the sub menu All of that is controlled with this order Number here Ok so That's a quick look at adding Admin views to your component I hope that is insightful enough for you to understand how to do that If you have any questions please you're welcome to send me a mail Thanks for watching

Clone this wiki locally