-
-
Notifications
You must be signed in to change notification settings - Fork 174
049 The New Library Manager Area
I'm very excited to announce the Actual Library manager implementation We busy with a pool request we should have it released within the next hour or so I'm very excited about this this new improvement Is really gonna make Libraries very Dynamic in JCB Not it has not been dynamic It's just Not in worries realise how easy it is to add new libraries So What I wanna do is quickly Not to elaborate x show you how it used to be done And then I want to jump into how it work now and you'll see why the new implementation is so much easier So much better and I think everybody's gonna enjoy it Ok so let's let's get started on how it used to work So if we go to a component and we open a component There are 3 libraries that are already built into JCB that just works out of the box And those 3 libraries can be selected With the add UI kit at food table Ok Let me see The other libraries that are being added Is a winner detects Basically some code in the certain areas of the script I'm not gonna elaborate on that Square take too long Point is this to you put select here simply By selecting You know now there's a new feature called dynamic And that is part of what we will need to look at Dynamic Basically means That it is added in on the basis of the views That are linked to the component So The Old Way You had to come to the component and sort of Talent here ok once you like it and I want food To table add it Anyway you could tell him you know what version you would like Or if you want it with the UI kit you could actually said that it adds both versions Now with improvements you'd said this to Dynamic which basically turns off The Global adding of the UI kit component And then Falls back Onto the new implementation which I will demonstrate with in a moment So let's leave it on this the way it was That was the first way of actually implementing some library The second way Which was their way that you could now scale it Is if you want to go to settings There is component files and folders that you could add So you could click here and say you don't what I want to I want to add a a Alive that isn't already part of JCB Ok so let's say you wanted to add Bootstrap So You would say ok there is a folder in your component on the administrative components Boland build up custom And inside that folder you placed the folder For Bootstrap so I don't have it here Let me quickly do that Is it now I'm just gonna refresh this page I I quickly went and added a folder to this custom folder Call Bootstrap Summer Just refresh this So I'm gonna get in click here And then there we have it select Bootstrap I want Bootstrap to be added to the media folder And since we do not do any Changing of the folder name will just leave that as it is So basically I move this folder into the media folder That's the way you would have done that in the past So close Now Having added the files to the component You will then Actually have to go to the view So if we go to side view And this looks View You will have to in the looks of you You know said That it actually now uses Now this is the new implementations I'm gonna undo that And just say Ok in the custom document script area You would add this snip it in here so you add a script now you know Show that you add the the Bootstrap 4 Folder to media But when it gets installed to Joomla It actually a create a component folder and put the A files in there If you do not know how they will work out at the folder install it onto Dumela website and go look in the media folder To get the correct path here And save and close and that's how you would in the past have extended JCB To actually use Other libraries then what's built into JCP And ok I list rated that simply so you know that we could have done this before But it was a little bit more complicated As the way it's going to work now So now With the new changes we've made You can actually Remove The The files If you have done this this manual way You can actually remove these files So close You don't need to add them any this way anymore They will be added on another way now I'm gonna demonstrate the the other way By actually starting at the libraries area Some closing out of the component I'm going to libraries And you see that with the upgrade There's now a Bootstrap 4 library uikit 3 2 Food table 2 and 3 and a no library Which is reading only necessary when greatest nippard it doesn't belong to any library Just your own snippet that you want to use So The Snippets are now directly linked to these libraries These libraries The 6th that would be Been shipped the JCB worth Should not be changed In relation to its name Or it's type But you can change its behaviour Bad behaviour is the file behaviour There are an a various file behaviours Let's open Bootstrap to show you some of those At the moment Bootstrap they said on always had And it is linking in basically a Content distributed Network link And it says that it it should add it as a link Now you can change that you can say no I don't want to add it as a link And you can edit this And Without Making any changes to the link you can change this to A local And that what JCP will then do Is during compilation he will download these files An add them into the component as local files Which would then be used instead as the link Which I think is quite nice You could also do the same thing here as we did previously you could add Files from the same custom folder And also folders Those are The same kind of implementation except It's now done on a library level So that even library gets add that to a view as I will show you in the moment You automatically use this Files So that means You don't need to do it Pro component You basically do it the library and I should link the libraries to Vuze It'll automatically incorporate these files into your component which makes it a little bit Less effort you just said it up once And thereafter you could just reuse reviews Do I'm gonna change this to local So now it will says local get There is an a few behaviours year there is a conditional custom script and do not add Now the cond Is still under development All these functionality used already here so you'll see all the links are showing up here But as related to its implementation in the compiler It's not ready yet So for now Skip the conditionals option until you see that when you compile that it doesn't give you a warning at This moment If you compile JCB Your give you a warning that the conditional options are not available yet I'm in fact we're planning to have them released with the next release Which would be 2.6 point 7 So any any version if you looking at this tutorial after 2.6 - 7 Then the conditional options are ready working So I'm gonna just demonstrated briefly The condition options works in two ways What is you first need to add some configuration fields How configuration fields Is basically Fields or be added to the global Options of the component And if those fields are tripped It will have an effect on whatever way you said it So to show you that If you look here you'd see there is an options area If we click on the options area That's now in a component you see there is uikit to settings And it has a bunch of Buttons here That's basically the kind of buttons That you can build So you first go and create the fields in JCB as you would normally create any other field And then in the library come here and click on getting the configuration fields So Here I'm just gonna select the anything so I'm just gonna say Add more maybe as an option And I want to Created under the tab called Food Strap Just like that So that's gonna be the tab name That's gonna be the the radio button Save and close this is the most Asian So now if I change this to configuration And I click on adding a configuration and then I say I want to add the local These two local files I want them to be included When add more is said to Yes That's basically How this configuration of conditions will work In a relationship so You won't see any option Fields if you haven't created Option fields In the configuration So if you if you wanna use this area when it is eventually getting in a.m. will be ready You will have an include and exclude option Based on buttons And then you select the files you that you want to Be added or Not not be added Based on these selections Now these buttons obviously as part of your component parameters And so within your code when you start developing at Amplats and your layouts You can draw upon these These parameters In your PHP And say ok if it's the switch is that then I want this HTML to load Otherwise I want that HTML to load So you could have Bootstrap alongside uikit With the same implementation So that is giving a idea of where this conditional Area is supposed to come into play The area that I have really like more is actually the custom scripting area Which really Is giving us the same behaviour as what we did in the side view right So we basically just add the same Files here And The only thing will change it will add Component component Like that Wherever we have the component name Because we want this to be Dynamic or that needs to be Three of those So that if it gets added to any component You'll dynamically update those names As related to The fact that it will use Bootstrap version 4 It really is using this name here And it's putting a little - between them and making it lowercase And These two files Are based on those names there so you basically need to use that name And That name And it will dynamically to take the this is a CSS file I put it in a CSS folder and same the same goes with age as a file So basically this is how you do a custom scripting for Bootstrap 4 And that that will be very similar to always add Because always add would basically write that script for you And so you just Add the files you always want to add And the behaviour is like this so Really I'm trying to give you as much Liberty as possible So that you can use libraries in any way you're like Write your own conditions Or your own custom script or just let JCP add it always Now I'm gonna demonstrate how this adding always is gonna work in a moment Can I save and close out of here So we have basically Bootstrap add always and UI kit at always And you like it Version 2 we using a built-in option as same for the food table and the food table Version 3 So the building options are only available for these 1 2 3 4 libraries Not for Bootstrap but for those for libraries And any other libraries that you add will not have a built-in option unless we build one and then it will become available Ok so that is sewing all around the libraries now Let's link the library to a view gonna go to side view I'm gonna go and open looks As the site View And basically I'm just gonna select Bootstrap 4 That's all the moment I select Bootstrap 4 the Snippets That will show up here will then be the Bootstrap 4 Snippets Since we do not anymore ship Snippets with JCB You'll have to install some slippers So let me show you that quickly You go to Snippets Are you don't really need to go to sleep it's Ok so the UI Kid Snippets are still being shipped But not the Bootstrap 4 Snippets You then click on get Snippets Select Bootstrap 4 And it will then load all the Bootstrap for Snippets that are available to the community You can deny the user bulk import Or you could import individual Snippets 4 Bootstrap 4 Once it's ready it will show you which ones are new So let's I'm gonna add That's Newport So yes I wanna do that So it's basically installing it And then I'm also gonna take that one Would you like to add it to say yes ok And also in so I've got over install to Bootstrap Snippets The way to install all of them since there's so many Is the use the bulk option So you could actually come here to bulk And you see that it has the new and you can click on this and it will install all of the the Bootstrap snippet Ok So that is the quick way of getting libraries Snippets into your system And installing them Just by clicking on On get snippet And it will basically do that for you Now let's go back to site views And again open the looks area So now if I select Bootstrap Then you'll see those two Snippets that I've been stalled And I can Click between them and really that's just for you to get the snippet And to be able to add it into your You know into your code Where ever you would like it to be like that Ok so I'm gonna do that I'm just gonna demonstrate Adding the library so selecting the library here Is what will add the library to the component and actually to this view So you can select Multiple libraries for one View But there could be a problem with that if you for example want you I get version 2 and UI Bike it Version 3 on this page but you want to have it Only use the one or the other based on certain switches in the global options of the component Now UI kit version 2 was set to fall back to Euro the internal Golden option And you like it Version 3 was said to fall back 2 Always add So if we just look at that Ok so that's always ADD and built-in Now you want to Actually have both libraries under the page But you wanted to work within some custom implementation the way to do that Click on new And use the bundler option Select Those two libraries Like that Decide how you want to do it so it will be possibly a custom script Or it will be a conditional one Which you will then have to create Obviously let me just say this So we could call those UI kit Bundle Let's call it just you like it like that And save Now Once you've saved it once You cannot you should now add the actual files So You would go to folders And then At you I get 3 wrong button Uikit 3 and 3 kids 2 And you wanna add them to the media folder So You have to still link the files remember kicks selecting those libraries Doesn't inherently Uno clone it's Files You need to still manually up the files so now we've got virgin 3 wait Why is this so difficult Erica The screens not working along here Ok you like it Version 3 and version 2 And save and close So now We have The files And here they are in as folders And it shows you all the files and folders That are found inside of those two folders that you've added So Yeah I think it's little difficult you cannot see which version is which year This might be a A good option to add Maybe the fall the name here I think they will be In the next release we will make that change But I think the other option which is also ideal for this kind of implementation is a custom scripting Which you could still create The the the config files Fields excuse me So when it when it's this UI kit version 2 is selected Load the UI kit version 2 files But you must understand if you create the buttons And it will be added to the component But if you use custom script And in here in the behaviour you write the custom script You need to Let me just show you in the file So in the file You see that it actually puts the parameters In params this params So You will need to down here Get The UI kit The switch the the button name That you are now Have tap created to the conflict fields You then get the value put it into a variable And then based on that variable You would either Add the file or or not at the farm So you basically write this script If I was to Just copy this is an example All the way up there And go here paste This is basically what the crust and scripted look like But that means that you created In the library config you created fire buttons With those names right And that the values are related to these values here They had a cheque option Is something that if you Do you go into the file you go look at the HP HP you might understand how to Use this And so the other chickens at this stage always being loaded If you don't wanna use the edit check then you just you know just don't use it But you could go and and try and figure out how the Heather check works And then use it Anyway so that is Making a bundle Now let me save this as an example And so now we got this UI kit And it's a bundle If we go back to the site View And we open that up again We will now instead of creating this one and that will do just create Select that bundle instead And that bundle will give me Uikit version to snip it and if we have any version 3 slip it's installed You also load that for me So I will be able to work with both libraries Why selecting is bundled Library option and JCB when it compiles He will basically use the the custom script that you wrote in The Bungalow To add it to the view so let me Show you that's all save and close You And let's go back to the library quickly And just do something silly to the code So that you will actually see it's implementation You gonna ads These bunch of lions here Save and close And then let's compile this Uninstall Ok let's look at the code So now you see that it's added in this library files Obviously it's also add it in The Originals because We haven't set that but not to show let me just show you what What I mean In the component You need to change the version Of the old library implementation You need to change that So now You need to change this from adding UI kit version 2 To basically two dynamic Save and close Knife we compile it now you will see it will not add the That that Coat To the file twice You're basically just add that you like it bundles Code that we wrote Ok let's look at the code So now We see that it only added the code that we wrote And then Remember in the Fire we added this as custom script So we need to go remove this In the end View We we added this in So interview we added these custom script We actually didn't need to add the spaces And we do have a little bit of a A discrepancy there Ok I'm gonna escape this just that you can see We don't need to add this in this way anymore We can go here And Basically That I still want that Bundler in there as well Ok so we don't need to do this anymore We can just Basically select Bootstrap Save and close And then I'm gonna run the compiler again There we go If you look at it hear it see that there is that escaped code that we removed And here is this code that JC be added Member I said to you that We basically in JCB We are LinkedIn We look at the library might not here Let's go here The Bootstrap 4 library reset ad always And we basically linking it from a link right and we just said local get Now if we look at the code We see that it Road For us this Pass So now I'll let check if it actually did add the path correctly So we wanna we wanna go to the media area of the of the Program And go to Me and not media Demo And so Received created a Bootstrap folder Added added to files According to the path That it's also set here so that it is really implementing the get Option For the libraries And all you really did is you just linked it to this view This does give another situation where To every view that you want is pacifically library to be available You need to link it To that View Which wouldn't be a problem If you prayed of you now and you said your library and then add the Snippets Then I mean then you're starting a fresh and you will actually select the right BC wanna use But if you since you haven't done this before all the components If you wanna use a library in the view You have to go and add it Or you just have to Basically in the components area for back On The Old Way of implementing The the libraries that are built into JCP so that means the old implementation still work If you If you basically set it here 2 Add both UI kit version 1 and 2 and 3 And also Maybe towards food table version 2 Does Implementations still work And doing that will add it to every customer and admin view where it's used Sorry Custom inside view custom admin view side view template layout So that that's the old way and that still works it's just that when you want to start using like Bootstrap 4 You'll have to actually link it to the custom at the view or side view template layout Where you want That specific Add library to be available So View link in Bootstrap over here Then it will be available to this layout and to every view where this layout is Used Ok so that's the quicker mistration of the new Libraries implementation We call it a library manager Because of The Diverse ways of you linking in the files and so forth We really hope that you Understood then are able to enjoy this new implementation We want to Make it possible for you to add libraries And then basically share this limits With the rest of community So those of you that are interested in doing that Please watch some of the previous tutorials about Snippets and the slip it manager Because I think doing this will not only help everyone else in the community but also get your name I'm out there I get people connected with with each other Anyway Thank you for watching
- Home
- Beta Testing
- Custom Code
- PHP Settings
- Demo Component
-
Tutorials
- Hello World JCB
- Intro JCB Guide
- JCB Installation Steps
- Planning Components
- Field Type Overview
- Basic Fields Creation
- Admin View Management
- Advanced Field Usage
- Admin Component Integration
- Component Setting Customization
- Scripting Components
- Component FTP Options
- Dynamic Get Method
- Site View DynamicGet
- Site View Templates
- Template Setup Guide
- Layout Configuration Steps
- Custom Admin Management
- Adding Site Views
- Custom Admin Integration
- MySQL Demo Tweaking
- Global JCB Settings
- Custom Time Field
- User Helper Integration
- Email Helper Usage
- Message Store Email
- List View Unescape
- Export Import Customization
- Overwrite Custom Fields
- List Field Filtering
- Automatic Code Import
- Manual Code Implementation
- Component Export Import
- Custom Admin Buttons
- Translation Management
- Site View Permissions
- Component SQL Updates
- Site Edit Configuration
- JCB Backup System
- Helper Structure Integration
- JCB v2.5 Upgrade
- Tab Setup Guide
- JCB v2.6 Release
- Extended HelloWorld
- Field Rule Validation
- Community Snippets Intro
- Snippet Forking Tutorial
- Pull Request Snippets
- Library Manager Area
- Excel-based Translation
- Dynamic Router Details
- Database Auto Updates
- Subform Quick Demo
- VDM Package Import
- Dynamic File Inclusion
- File Field Upload
- Drag-n-Drop Upload
- Quick HelloWorld JCB
- Non-database Fields
- Dashboard Customization
- Menu Prefix Toggle
- Community JCB Packages
- Collaborative JCB Workflow
- JCB Package Install
- JCB JAB18 Event
- Convenient New Fields
- Component Language Strings
- Library Functionality Anticipation
- Join Field Relations
- License Template Change
- Code Reusability
- Local Dev Environment
- Extended Field Types
- Joomla Custom Fields
- Custom Field Expansion
- Site View Listing
- Run Expansion Method
- Form Site View
- Field URL Update
- Additional Helper Methods
- Field Validation Rules
- New Placeholder Feature
- Component Config Params
- Per-field Default Values