Updated 046 General overview of how community snippets work (markdown)

Amigo 2019-08-27 08:36:53 +02:00
parent 56b57c9a25
commit 1b0a803daf
1 changed files with 13 additions and 11 deletions

@ -28,25 +28,25 @@ Now how does that exactly work? Well, Snippets that already exist are Snippets t
[00:03:58](https://www.youtube.com/watch?v=qr4I1jeCp7I&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h03m58s)
What is important though is that your Snippet is mapped the same way as the Snippets in the community. For example if the Name: Grid, Library: UiKit v2 is called Type: Layout then do not change it because it will then behave like a new Snippet and not like an existing one. [00:04:17](https://www.youtube.com/watch?v=qr4I1jeCp7I&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h04m17s) Because the community uses the Name the Library and the Type to build the Filename. All you need to know is there are a bunch of Snippets already in your component. [00:04:38](https://www.youtube.com/watch?v=qr4I1jeCp7I&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h04m38s) These snippets were shipped with Joomla Component Builder. This is how it was by default.
What is important though is that your Snippet is mapped the same way as the Snippets in the community. For example if the Name: Grid, Library: UiKit v2 is called Type: Layout then do not change it because it will then behave like a new Snippet and not like an existing one. [00:04:17](https://www.youtube.com/watch?v=qr4I1jeCp7I&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h04m17s) Because the community uses the Name, the Library, and the Type to build the Filename. All you need to know is there are a bunch of Snippets already in your component. [00:04:38](https://www.youtube.com/watch?v=qr4I1jeCp7I&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h04m38s) These snippets were shipped with Joomla Component Builder. This is how it was by default.
### Area Called: Get Snippets
[00:04:48](https://www.youtube.com/watch?v=qr4I1jeCp7I&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h04m48s)
There is an area called 'Get Snippets'. If you would like to get your name out there and want to become involved in the JCB community this is the ideal opportunity to do that through sharing a Snippet. Say, for instance, you have created 'Article Snippet', then you can click on 'Share Snippets' or you may take more than one, it should not necessarily be only one. You can click 'Share Snippets'. This will then create a package. It can be seen that it created a package. It is placed in this Path folder(/media/host/Dropbox/sandbox/joomla/tmp/snippets.zip.)
There is an area called 'Get Snippets'. If you would like to get your name out there and want to become involved in the JCB community this is the ideal opportunity to do that through sharing a Snippet. Say, for instance, you have created 'Article Snippet', then you can click on 'Share Snippets' or you may take more than one, it should not necessarily be only one. You can click 'Share Snippets'. This will then create a package. It is placed in this Path folder(/media/host/Dropbox/sandbox/joomla/tmp/snippets.zip.)
### Helper Tutorials - Few Links And Shortcuts To Get Involved Sharing Snippets
[00:05:33](https://www.youtube.com/watch?v=qr4I1jeCp7I&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h05m33s)
There are a few helper tutorials to get you going. If you want to learn this tutorial I am making now will be this link: https://www.youtube.com, and if you want to learn more about Git, it is this one: https://www.udemy.com/git-quick-start/, and if you want to know how the forking is going to work, then it is this: https://www.youtube.com. If you want to know how to do a pull request, it will be this one: https://www.youtube.com [00:05:55](https://www.youtube.com/watch?v=qr4I1jeCp7I&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h05m55s) If there are any issues you can open an issue on GitHub: https://github.com/vdm-io/Joomla-Component-Builder-Snippets/issues. This gives you a few links and shortcuts to get involved in sharing Snippets.
There are a few helper tutorials. For example, If you want to get help from this tutorial which I am presenting now; Use this link: https://www.youtube.com, and if you want to learn more about Git, it is this one: https://www.udemy.com/git-quick-start/, and if you want to know how the forking is going to work, then it is this: https://www.youtube.com. How to do a pull request, it will be this one: https://www.youtube.com [00:05:55](https://www.youtube.com/watch?v=qr4I1jeCp7I&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h05m55s) If there are any issues you can open an issue on GitHub: https://github.com/vdm-io/Joomla-Component-Builder-Snippets/issues. This gives you a few links and shortcuts to get involved in sharing Snippets.
### What Happens When You Share Snippets?
[00:06:07](https://www.youtube.com/watch?v=qr4I1jeCp7I&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h06m07s)
What happens when the Snippet is shared? If someone clicks on 'Get Snippets', then they will see your name if that specific Snippet comes up. To illustrate that: If we click on Get Snippets it might take a moment depending on how many Snippets are in the repository at this stage because it is getting all the Snippets via Ajax from GitHub and it is building a little page. [00:06:38](https://www.youtube.com/watch?v=qr4I1jeCp7I&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h06m38s) It has just loaded the whole bunch of Snippets. The first view shows all the current Snippets in the JCB community Snippets Repository. Go to this repository by simply clicking on this GitHub link.
What happens when the Snippet is shared? If someone clicks on 'Get Snippets', then they will see your name if that specific Snippet comes up. To illustrate that: If we click on Get Snippets it might take a moment depending on how many Snippets are in the repository at this stage because it is getting all the Snippets via Ajax from GitHub and it is building a small page. [00:06:38](https://www.youtube.com/watch?v=qr4I1jeCp7I&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h06m38s) It has just loaded the whole bunch of Snippets. The first view shows all the current Snippets in the JCB community Snippets Repository. Go to this repository by simply clicking on this GitHub link.
### Snippets - In Sync
@ -58,39 +58,41 @@ You can see which of these Snippets are already In Sync. It is called EQUAL. It
[00:07:22](https://www.youtube.com/watch?v=qr4I1jeCp7I&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h07m22s)
Then if there is a Snippet Out of Date. For instance, someone contributed to the community on a specific snippet. Let's say it this Snippet Uitkit v2-(Common) Alert. If someone sees that we have opened the Snippet, they see this little snippet(see video) and feel, that they can improve on it, and share it with the community. Then that Snippet will end up in the 'Out of Date tab'. If there is no 'Out of Date Snippets', then all will be blank. But if there are any Snippets that are 'Out of Date', they will all show up.<<<<<<
Then if there is a Snippet Out of Date. For instance, someone contributed to the community on a specific snippet. For instance, this Snippet Uitkit v2-(Common) Alert. If someone sees that we have opened the Snippet, they see this little snippet(see video) and feel, that they can improve on it, and share it with the community. Then that Snippet will end up in the 'Out of Date tab'. If there is no 'Out of Date Snippets', then all will be blank. But if there are any Snippets that are 'Out of Date', they will all show up.
### Snippets - New
[00:07:57](https://www.youtube.com/watch?v=qr4I1jeCp7I&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h07m57s)
Then there is the New tab. Now the New tab could be a little bit misleading because, in this example, I went and deleted a Snippet from my Database. Since that Snippet already exists in the community, the system then detects that snippet is not here so it must be new. That is how it worked out. Now you could click on this Get Snippet and it will say: [00:08:28](https://www.youtube.com/watch?v=qr4I1jeCp7I&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h08m28s) 'Are you sure you would like to add this new JCB community snippet to your local snippets'? You say: 'OK'. Then it goes to GitHub, gets the snippet and moves it to your Database. You are done. This Snippet is no longer New. If you click New you will see no New Snippets. It has also been added locally.
Then there is the New tab. Now the New tab could be a little bit misleading because, in this example, I went and deleted a Snippet from my Database. Since that Snippet already exists in the community, the system then detects that the snippet is not here so it must be new. Now you could click on this Get Snippet and it will say: [00:08:28](https://www.youtube.com/watch?v=qr4I1jeCp7I&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h08m28s) 'Are you sure you would like to add this new JCB community snippet to your local snippets'? You say: 'OK'. Then it goes to GitHub, gets the snippet and moves it to your Database. You are done. This Snippet is no longer New. If you click New you will see no New Snippets. It has also been added locally.
### Snippets - Diverged
[00:08:49](https://www.youtube.com/watch?v=qr4I1jeCp7I&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h08m49s)
Then Diverged Snippets is where there is a discrepancy in both the creation date as well as the modified date. Those snippets will show up in 'Diverged' and they can be updated in the same way. If you have made a change to a Snippet in your local environment and then you have realized that changes have not been good, it is better to return to the old Community version.
Then 'Diverged Snippets' is where there is a discrepancy in both the creation date as well as the modified date. Those snippets will show up in 'Diverged' and they can be updated in the same way. If you have made a change to a Snippet in your local environment and then you have realized that the changes have not been good, it is better to revert to the old Community version.
### Snippets - Ahead
[00:09:18](https://www.youtube.com/watch?v=qr4I1jeCp7I&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h09m18s)
Then go to 'Ahead'. A little change has been made to this specific Snippet. They will tell you that the Snippet is 'Ahead' and if you click on it, they will show you what that would mean. You can then click on Get snippet, to revert back to the old one, and that is what it will indicate. 'Are you sure you would like to update your local snippet to this older JCB community snippet?' You can say, 'Cancel'. I like the new snippet I do not want to update it and just ignore it. But if you want to return, then there is this option to do so. [00:09:51](https://www.youtube.com/watch?v=qr4I1jeCp7I&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h09m51s) If this is a good Snippet you might want to consider sharing it with the rest of us. That would be to do the sharing snippet and go through those tutorials in knowing how that works.<<<<<
Then go to 'Ahead'. A little change has been made to this specific Snippet. They will tell you that the Snippet is 'Ahead' and if you click on it, they will show you what that means. You can then click on Get snippet, to revert to the old one, and that is what it will indicate. 'Are you sure you would like to update your local snippet to this older JCB community snippet?' You can say, 'Cancel'. I like the new snippet I do not want to update it and just ignore it. But if you want to return, then there is this option to do so. [00:09:51](https://www.youtube.com/watch?v=qr4I1jeCp7I&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h09m51s) If this is a good Snippet you might want to consider sharing it with the rest of us. That would be to do the sharing snippet and go through those tutorials in knowing how that works.
### Bulk Tool
[00:10:05](https://www.youtube.com/watch?v=qr4I1jeCp7I&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h10m05s)
There is sometimes a situation where a specific person of the community might be very enthusiastic and he contributes 300 new snippets to the community Snippets Repository. Now that would mean that you want to click on every one of those snippets Get snippet, Get snippet, that might be very tedious. So we added this little Bulk tool. The Bulk tool is able to detect whether there are New snippets and whether they are Ahead snippets or whether you just wanted to update all of them with this 'Just Get All Snippets'. [00:10:42](https://www.youtube.com/watch?v=qr4I1jeCp7I&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h10m42s) If there isn't any Diverged or any Out of Date Snippets, it will also not be able to do that. Instead of clicking it one at a time you could just click on 'Revert All Ahead Snippets' and it'll just update all of them for you and you're done.
There is sometimes a situation where a specific person of the community might be very enthusiastic and he contributes 300 new snippets to the community Snippets Repository. Now that would mean that you want to click on every one of those 'Get Snippets', that might be very tedious. So this small Bulk tool had been added. The Bulk tool is able to detect whether there are New snippets and whether they are 'Ahead' snippets or whether you just wanted to update all of them with this 'Just Get All Snippets'. [00:10:42](https://www.youtube.com/watch?v=qr4I1jeCp7I&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h10m42s) If there is not any Diverged or any Out of Date Snippets, it will also not be able to do that. Instead of clicking it one at a time you could just click on 'Revert All Ahead Snippets' and it will just update all of them and you are done.
### Description, Usage, Snippet, Who Contribute, View Blame
[00:10:57](https://www.youtube.com/watch?v=qr4I1jeCp7I&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h10m57s)
But if you like me and you want to know exactly what's going on you could read the Description. There's no Description. See the Usage. See how the Snippet itself looks like. If you really like what you see [00:11:12](https://www.youtube.com/watch?v=qr4I1jeCp7I&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h11m12s) you might even want to look at who contributed the Snippet. That brings up an important and yet interesting concept. We have decided that when you contribute a new snippet your name and details will end up here(who contributed the snippet). Like I explained earlier when we looked at the contributor area. Yet when someone makes minor contributions to the snippet, we will not necessarily change or replace this Contributor's name. Instead, we will let them show up in the blame view. There is a view [00:11:46](https://www.youtube.com/watch?v=qr4I1jeCp7I&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h11m46s) which is called the Blame View. The Blame View shows you who changed what part of the code and when. Whenever there is an improvement on any of the Snippets the GitHub Repository tools will help us show you who made those changes. So that's how they will be recognized for their contributions, is via the Blame. Where is if you contribute new Snippets to the JCB community you will end up having your details show up here and have people be able to click on this link 'Vast Development Method' [00:12:17](https://www.youtube.com/watch?v=qr4I1jeCp7I&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h12m17s) and go to the website you put up as your website. It's an ideal way of getting yourself out there in the JCB community and at the same time sharing good snippets with the rest of us and make our life easier. That is looking at the Get Snippets Community area.
There is a 'Description' if you like to look at it. There is 'Usage'. See how the Snippet itself looks like. If you really like what you see, you might even want to look at who contributed the Snippet. [00:11:12](https://www.youtube.com/watch?v=qr4I1jeCp7I&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h11m12s)That brings up an important and yet interesting concept. We have decided that when you contribute a new snippet your name and details will end up here('who contributed the snippet'). Like I explained earlier when we looked at the contributor area. Yet when someone makes minor contributions to the snippet, we will not necessarily change or replace this 'Contributor's' name. Instead, we will let them show up in the blame view. There is a view which is called the 'Blame View'. [00:11:46](https://www.youtube.com/watch?v=qr4I1jeCp7I&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h11m46s) The Blame View shows who changed what part of the code and when. Whenever there is an improvement made on any of the Snippets, the GitHub Repository tools will help us to know who made those changes. So they will be recognized for their contributions via the 'Blame View'. Where, if you contribute new Snippets to the JCB community, your details be displayed and make it possible to click on this link 'Vast Development Method'(Please follow on video) and go to the website you had put up.[00:12:17](https://www.youtube.com/watch?v=qr4I1jeCp7I&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h12m17s) It is an ideal way to expose yourself in the JCB community and at the same time to share good snippets. We hope that this will really foster a lot of participation and that it will improve JCB constantly. [00:12:52](https://www.youtube.com/watch?v=qr4I1jeCp7I&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h12m52s)
We're excited about this. We hope that this will really faster a lot of participation and that it will improve JCB constantly. [00:12:52](https://www.youtube.com/watch?v=qr4I1jeCp7I&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h12m52s) Snippets are used in these fork key areas Custom Admin Views, Site Views, Templates, Layouts. These areas are what the customer sees, the one that uses the component. We want to be always sure to have the latest and most stable Snippets ready and available for everyone using JCB. [00:13:16](https://www.youtube.com/watch?v=qr4I1jeCp7I&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h13m16s) Once you have imported the new snippet you will be able to see it at the end of your Snippets. Navbar is now the latest one we've imported. If you open the snippet, you will see that contributed details are already in place and so these contributed details will be updated as you add new Snippets.
### Snippets Used in Four Key Areas
Snippets are used in these four key areas Custom Admin Views, Site Views, Templates, Layouts. These areas are what the customer sees, the one that uses the component. We want to be always sure to have the latest and most stable Snippets ready and available for everyone using JCB. [00:13:16](https://www.youtube.com/watch?v=qr4I1jeCp7I&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h13m16s) Once you have imported the new snippet you will be able to see it at the end of your Snippets. 'Navbar' is now the latest one that has been imported. If the snippet is opened, you will see the contributed details are already in place and so these contributed details will be updated as you add new Snippets.<<<<<<<<
### When Details Not In Place - Say Dynamic Field