Skip to content

018 Custom Admin Views

Llewellyn van der Merwe edited this page Dec 19, 2018 · 12 revisions

I need to have a quick look at custom admin views They do have some nice ways of doing things Very similar to sight views But some Aspects and adding a two component builder is different And so in the next video We will look at adding site fuses well as component Custom admin Views To the component The reason I didn't speak much about the custom admin user simply because Summon distributor is not Using Custom admin views yet Where is I have another component here I can use as a example Called component It's cold Waited Sia Cost-benefit projection It's a It's a tool that is used to show companies the cost benefits Of intervening on certain diseases and causes in the company Anyway In it we have what we call a company results And combined results Respectively used To display custom data In the back in of the component 2 to the 7 different The people who has permissions to view those data Now in the component itself If we clicked on companies You see there is an icon on the knees each of these Names of the Companies And there is a new button here the top called combine Results Now This button as well as those buttons Are dynamically added by component Builder And in the next week tomorrow I'll show you exactly how that is done What I want to show you here Simply how a custom admin view will look So I'm gonna click on one of these these out this is all dumb information so So you'll see me Let's open this one Now basically you have this big area where you could put a lot of HTML and PHP And you have some custom buttons that you can add on show you that And then So all of this in this white area is simply done in the custom View So if I was to click around I've got a menu here at the side All of this is done inside of the custom Area Of the component Which is the other Custom admin View And That is basically how it will look Different Value sets And you can from here and an edit button Since we've linked it to a specific client Our company or one item in that list We can actually click on edit From here we are riding to the company's data And edit it And What is nice if we were to click close the year You actually take us back to that Exact result page And you can then go and look at The implementation What you've done Is it that is just simply showing you how a custom at nephew could look Let's go back to the company's list or we could go back to dashboard Download component Builder And we looked at discomfort company results we open at 1 And here is older PHP and HTML On my page Doing all the work Adolf course As you might expect I'm loading in a lot of templates here So I'm loading in templates Directly From here And Then I have a custom button area Where I can I can say yes I want to add custom buttons Then I click on Custom buttons here and you see I have Icons I can select Cornet The name of the button And a controller method Which I would like to use to actually make the button work so in this one I'm saying go to company This one is edit company And So I should say Is is this gonna What What kind of Target are we think looking at Is this a A single a list or both And you said that respectively And Then you click save this only saves it to the form not to the database We should have made that done But this is the tumor last way up in committing it And now you have to add In the PHP controller method Add scripting 2 respectively implement the buttons click Method You can also do the model So in the controller You can add script and then in the model Add scripting which is called from the controller if you want to separate your code a bit In the in the and if you're not gonna be adding Any script to the model Just add 9 Movies to Spaces in front of a wise it might scream at you that you Script there And as you can see the go to companies as simply Taking me back to the company's View Where is the Edit company Implements the German horse convention of opening an item to edit it By the correct channels so this is just At work here And we are checking a token and all that So do Miller Bodybuilders sets of all the tokens and everything So you The snippet you can reuse for your purposes if you want And obviously we have an area for Preston scripting and as you can expect There's a lot of practice custom scripting Going on In in that View And it has its respective places again if you wanna know where what's happening at some snippet here Compiler components search for that snippet and you'll see where this comes up If you not certain by the naming conventions refused And that is really how you setup a Hey admin custom admin View To look at the other one Let's close out here That is the combined results View Now the combined results is this one up here if you click it now I will tell you this we need to have some item selector And then you select the items and click There again And it will do a combined resolve Taking both companies And Adding it's data together And giving you a nice layout structure Of office that assets Ok That is really the combined concept If we go back To the limitation of it It looks very similar is the other Again just a lot of HTML PHP here And then Also some Preston button is again just going back to companies And it's really just same implementation B card companies go back single And then some custom scripting And that's how I set up both of those custom views What simply Adding that the data here And then making use of the templates as well as layout implementation in both of these So you can set up layouts and templates and Only use them and side views But you can also use them in at the views Now In our next tutorial We look at how to add side views and admin views to your component Since there are some differences And you need to be aware of them

Clone this wiki locally