diff --git a/051-Dynamic-Router-Implementation-Explained.md b/051-Dynamic-Router-Implementation-Explained.md index 867fa33..935f11e 100644 --- a/051-Dynamic-Router-Implementation-Explained.md +++ b/051-Dynamic-Router-Implementation-Explained.md @@ -1 +1,45 @@ -I would like to demonstrate to you the new implementation Which isn't such a major thing but Something we've done to try and Help along some of the router complexity So when you build a component And you have a front end [00:00:17](https://www.youtube.com/watch?v=hYycPLbaMos&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h00m17s) For your component so you've got site views Your site views usually are getting it's data from a dynamic get Which you link up to the site View and this dynamic get basically returns a Resultset and it is from this result set That we should get information By which we Combined with the view name Build what is called a [00:00:46](https://www.youtube.com/watch?v=hYycPLbaMos&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h00m46s) Search engine friendly URL your search engine friendly URL is basically done with the router So JCB also builds the router And it sort of guesses what should be these values So let me compile a component And show you what it guessed And then see how we would need to change it the component that we're working with here is Sermon Distributer So I'm gonna compile it And install it to this website [00:01:16](https://www.youtube.com/watch?v=hYycPLbaMos&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h01m16s) as now the router doesn't really work I'm not gonna demonstrate the actual front-end I'm just gonna show you the code And And let's take it from there So when you look at the website you've got your root directory admin And then components And then in here we've got Sermon Distributer And there's a file called router [00:01:44](https://www.youtube.com/watch?v=hYycPLbaMos&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h01m44s) I'm gonna open this And you'll see there's got a function called build I'm a class method As well as a function called parse and in this function called parse There is a switch Which basically Makes decisions based on the segment's First value [00:02:08](https://www.youtube.com/watch?v=hYycPLbaMos&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h02m08s) And if that segment's value is Because usually that would be the view name In this first Value it determines which view are we looking at is it preacher And so we going through the list Now by Default without us You know making any changes JCB Builders for us [00:02:31](https://www.youtube.com/watch?v=hYycPLbaMos&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h02m31s) All of it So If we look at preachers Which is a Basically a listview Let's open the preacher model So here is preachers We can scroll down And we'll see that In its [00:02:51](https://www.youtube.com/watch?v=hYycPLbaMos&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h02m51s) Query It basically has a get items and here it got a list query And it really is just getting all the items from Database With no input from the URL whatsoever Let's see Yeah it doesn't do any of that and then it just Gives back So it's a simple as that It does not Need a URL value [00:03:18](https://www.youtube.com/watch?v=hYycPLbaMos&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h03m18s) So that means it most probably will only Set this verse Value And all of this will really be redundant, it won't be used Because it's a listview So there isn't an alias We not looking at an individual item so there isn't an ID So we could Actually remove this here This code [00:03:44](https://www.youtube.com/watch?v=hYycPLbaMos&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h03m44s) It's not doing anything Now It is also not gonna really Slow your site down that Dramatically it's fact it's it's hardly noticeable It's it's just that this is default Being generated Where us if we look at for example Preachers is the list view but then there is a view called preacher we see it here And it is saying that [00:04:09](https://www.youtube.com/watch?v=hYycPLbaMos&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h04m09s) It needs to get the ID from Discernment table Which is actually in error So if I open the preacher And I look at the list query Then I see that in the list query about here It is getting an ID From the URL And it is asking that it should be equal to preacher So [00:04:34](https://www.youtube.com/watch?v=hYycPLbaMos&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h04m34s) It is the main table is Is the Sermon table But it's not looking for the Sermon ID It is looking for the preacher Value in the Sermon table and that's why JCB be fell back onto the table name And yet It should actually go to the preacher Table and See weather [00:04:59](https://www.youtube.com/watch?v=hYycPLbaMos&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h04m59s) That preacher value is equal to this ID So it is actually Making an error Now you wrote the code or you set up the get so you should understand the logic of what you see in the code here If you do not Then This is a feature with JCB has with you possibly won't be able to you know make use of Like we've said many times JCB is for those who know PHP And can actually write their own components [00:05:29](https://www.youtube.com/watch?v=hYycPLbaMos&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h05m29s) Now I know that this is an error because we want to actually get the value the ID Of the preacher Is the one we need to check And it is is doing it wrong it should This value here should be preacher not sermon You can look at the getVar class here at the bottom Here is the getVar class And here you can see what it's going to do And how it's going to actually get the values [00:05:56](https://www.youtube.com/watch?v=hYycPLbaMos&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h05m56s) So you can also use the getVar class for your own purposes So At this point we see at least one of the Router case Within the parse method In the case loop there's at least one router area that needs to be changed I know by having looked at this before That there is actually more than one it's also this categories [00:06:25](https://www.youtube.com/watch?v=hYycPLbaMos&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h06m25s) Down here This one Should also change This should also become Well actually it should just get a true Here there should be true because this is a category Look up Now the other place it also need to change is this one There should also be serious [00:06:43](https://www.youtube.com/watch?v=hYycPLbaMos&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h06m43s) So this is where the guessing which JCB does Dynamically Did not match the complexity of our Dynamic get And I'm sure that as time goes on we might Improve it's Guessing Ok we might get better ways of guessing correctly And Within the dynamics of the dynamic get Be able to actually build this case more effectively but Since we have not done that yet [00:07:17](https://www.youtube.com/watch?v=hYycPLbaMos&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h07m17s) The quickest way for us to resolve this and which most probably be the most Dynamic option Is actually adding a way that you can replace the snippet of code Targeting the specific View So you will never need to really know what is the view When you do this because they are placeholders And you need only remember where you at your dynamic Get So let me go and illustrate this within the JCB interface So all I wanted to show you here is that we are actually targeting with this new Dynamic implementation [00:07:53](https://www.youtube.com/watch?v=hYycPLbaMos&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h07m53s) This little snippet This area here We not replacing the whole method Because really it is it is standard there's not much to do in Improving that and if we do it will be just improving it for everyone And the built function it really works well I haven't seen any issues with that So At the end of the day it seems like only the parse method Needed a bit of an improvement So let's go back to the interface and let me let me show you [00:08:22](https://www.youtube.com/watch?v=hYycPLbaMos&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h08m22s) Where we can make the changes To have the the category render correctly As well as the preacher This one here as well as the series ........... ............ Basically make the changes so that this will say Series And That this one will say true [00:08:48](https://www.youtube.com/watch?v=hYycPLbaMos&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h08m48s) And this one This preacher would also say Preacher That's basically all we need to do and then this router Will work Without any errors Ok So here in the interface you have site views Now the site views the ones who wanna make changes to his this preacher The series and the category now I'm gonna show this to you little bit [00:09:15](https://www.youtube.com/watch?v=hYycPLbaMos&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h09m15s) Long winded but Bear with me It's just make sure everybody is on the same page If you open preacher You would see that it has a dynamic Get called Sermons preacher ID and it say get list query Ok so This is the one We want to change [00:09:35](https://www.youtube.com/watch?v=hYycPLbaMos&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h09m35s) The get the dynamic get As well as speaking about serieses The same is true of that We have this List query get series ID Sermons that we also want to change And so we not changing it in the view The idea was That if we change it in the dynamic get it automatically [00:09:57](https://www.youtube.com/watch?v=hYycPLbaMos&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h09m57s) Right to correct code to whatever view you add it because we've added some custom Scripting Sorry placeholders within the script So let's take the first one is this sermon Where is it Sermon series So in custom script we scroll down to the bottom there is now a new Tab here option here Add PHP Parse method in router little bit of explanation there [00:10:29](https://www.youtube.com/watch?v=hYycPLbaMos&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h10m29s) click yes And it will Dynamically load What is what I can consider the most basic implementation of that little snippet So you see it looks very familiar it's got his place holders And it has a specific It has a specific S View placeholder That's because we're dealing with the site View And it has to have this s in it To replace it with the site view name [00:10:55](https://www.youtube.com/watch?v=hYycPLbaMos&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h10m55s) So wherever this is gonna be used this this Dynamic get This Would be replaced with that specific site view's value Ok that's just to give you a heads up About the place holder and that's what makes it dynamic So that you can use it in any site view and it will automatically write this Because really the the display of the page is actually based on the database request Which is built in the URL by the name of the view As well as the ID of the element And if there are multiple variables being passed [00:11:32](https://www.youtube.com/watch?v=hYycPLbaMos&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h11m32s) To the URL You can obviously update that and Replace multiple values So Here we want to within this one Did the default option here will actually resolve our issue because Remember these two values were not the same JCB's Dynamic build actually changed this value to Sermon instead of [00:11:57](https://www.youtube.com/watch?v=hYycPLbaMos&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h11m57s) Leaving it The same And there is a very good reason For that Usually this would be the correct response but in this case because of complexity I'm not gonna explain It isn't the correct response and so you want these two values to be the same And it is basically the site view's name So we could just save it close this The next one we wanna do is this sermon preacher And it was also [00:12:25](https://www.youtube.com/watch?v=hYycPLbaMos&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h12m25s) Having the same issue basically So we We gonna do the the same kind of Just add the the custom Option To ensure that these two values remain the same And then the last but not least was this category It is also behaving Incorrectly And really it's only because it [00:12:47](https://www.youtube.com/watch?v=hYycPLbaMos&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h12m47s) Didn't detect That this is actually category And that is primarily because it is using the Sermon table To to start instead In the Sermon table We have a joint here too category If you can see there And so it does load the category and [00:13:12](https://www.youtube.com/watch?v=hYycPLbaMos&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h13m12s) the tweak You see that we are actually using This ID And this is a category ID So it should actually go look for the category And build the parse method based on the category And so here We also gonna Just Add [00:13:33](https://www.youtube.com/watch?v=hYycPLbaMos&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h13m33s) A true To this getVar Which tells the getVar method that this is actually a category This this name In effect is actually gonna be ignored Because it's gonna not be looking for this tables value is gonna go to the category table And look for the value there Ok so this will resolve this this issue We can save and close this one [00:13:59](https://www.youtube.com/watch?v=hYycPLbaMos&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h13m59s) So now we have Done some customisation to our router Just by adding those Values to the dynamic get If we compile our components now It will automatically fall back Unto those Values Just install again [00:14:21](https://www.youtube.com/watch?v=hYycPLbaMos&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h14m21s) And now let's go look at the code So we see here That it did exactly what he wanted it added preacher preacher there And this is now Categories is true And We see the series is series And so now at least we know that this actual The router will behave correctly This is the first step of our improvement to the router [00:14:49](https://www.youtube.com/watch?v=hYycPLbaMos&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h14m49s) It seems to me that we already have a very workable Situation and this is really gonna make it too much better There was also the idea of adding some custom scripting into the built Method And we will look at that And I invite You and anyone else too To get involved On this on GitHub just if you know how to improve his even more Then please [00:15:16](https://www.youtube.com/watch?v=hYycPLbaMos&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h15m16s) I get in contact with me and let's let's work together This is so what we've done so far But like an all iterative developing concepts Will continue improving this To the point where it really serves as well And holds up with changes also happening in Joomla itself Ok well thanks for watching +# DYNAMIC ROUTER IMPLEMENTATION EXPLAINED + +### New Implementation - Help For Router Complexity + +[00:00:00](https://www.youtube.com/watch?v=hYycPLbaMos&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h00m00s) + +I would like to demonstrate to you the new implementation which isn't such a major thing but something we've done to try and help along some of the router complexity. When you build a component and you have a front end [00:00:17](https://www.youtube.com/watch?v=hYycPLbaMos&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h00m17s) for your component, and you've got Site Views. Your Site Views usually are getting it's data from a Dynamic Gets which you link up to the Site View. This Dynamic Gets returns a result set and it is from this result set that we should get information by which we combined with the view name, build what is called a [00:00:46](https://www.youtube.com/watch?v=hYycPLbaMos&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h00m46s) search engine friendly URL. + +### Search Engine URL Is Done With Router - JCB Builds Router + +[00:00:49](https://www.youtube.com/watch?v=hYycPLbaMos&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h00m49s) + +Your search engine friendly URL is done with the router. JCB also builds the router and it sort of guesses what should be these values. Let me compile a component and show you what it guessed, and then see how we would need to change it. The component that we're working with is Sermon Distributor. I'm going to compile it, and install it to this website. [00:01:16](https://www.youtube.com/watch?v=hYycPLbaMos&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h01m16s) The router doesn't really work. I'm not going to demonstrate the actual front-end. + +### Code - 'com_sermondistributor' - router.php + +[00:01:26](https://www.youtube.com/watch?v=hYycPLbaMos&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h01m26s) + +I'm just going to show you the code. When you look at the website you've got your root directory 'Joomla mount', 'admin' and then 'components'. In here we've got and there's a file called 'router.php'. + +### parse - switch(segments[]) - First Value + +[00:01:44](https://www.youtube.com/watch?v=hYycPLbaMos&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h01m44s) + +I'm going to open router.php. You'll see there's a function called 'build', a class method as well as a function called 'parse'. In this function called parse, there is a 'switch' which makes decisions based on the 'segment's' first value. [00:02:08](https://www.youtube.com/watch?v=hYycPLbaMos&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h02m08s) Usually that would be the view name in this first value. It determines which view are we looking at, is it preacher? and so we are going through the list. By default without us making any changes, JCB builds that for us, [00:02:31](https://www.youtube.com/watch?v=hYycPLbaMos&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h02m31s) all of it. + +### preachers - Getting All Items From Database With No Input From URL + +[00:02:33](https://www.youtube.com/watch?v=hYycPLbaMos&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h02m33s) + +If we look at preachers, which is a listview. Let's open the model, preacher.php. Here is preachers, we can scroll down and we'll see that in its [00:02:51](https://www.youtube.com/watch?v=hYycPLbaMos&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h02m51s) query, it has getItems and here it got a getListQuery. It is getting all the items from Database with no input from the URL whatsoever. It doesn't do any of that and then it just gives back. It does not need a URL value. [00:03:18](https://www.youtube.com/watch?v=hYycPLbaMos&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h03m18s) So that means it most probably will only set this value. All of this(see video) will really be redundant, it won't be used, because it's a listview, there isn't an alias. We not looking at an individual item so there isn't an id, we could remove this here(see video), this code [00:03:44](https://www.youtube.com/watch?v=hYycPLbaMos&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h03m44s) it's not doing anything. It is not going to slow your site down that dramatically, it's hardly noticeable. It is default being generated. + +Where as if we look at this for example, preachers is the listview, but then there is a view called preacher, we see it here. It is saying that [00:04:09](https://www.youtube.com/watch?v=hYycPLbaMos&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h04m09s) it needs to get the id from the sermon table. Which is an error. If I open the preacher, and I look at the getlistQuery, then I see that in the getListQuery, it is getting an id from the URL. It is asking that it should be = to preacher. [00:04:34](https://www.youtube.com/watch?v=hYycPLbaMos&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h04m34s) It is the main table, the sermondistributor table, but it's not looking for the sermon id, it is looking for the preacher value in the sermon table. That's why JCB be fell back onto the table name. Yet it should go to the preacher table and see whether [00:04:59](https://www.youtube.com/watch?v=hYycPLbaMos&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h04m59s) that preacher value is = to this id. It is making an error. You wrote the code or you set up the get so you should understand the logic of what you see in the code. If you do not, then this is a feature with JCB has, which you possibly won't be able to make use of. Like we've said many times JCB is for those who know PHP, and can write their own components. + +### getVar Class - See What It Is Going To Do - How It Is Getting The Values + +[00:05:31](https://www.youtube.com/watch?v=hYycPLbaMos&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h05m31s) + +I know that this is an error because we want to get the value, the id of the preacher is the one we need to check. It is doing it wrong, this value here should be preacher not sermon. You can look at the getVar class here at the bottom. Here you can see what it's going to do, and how it's going to get the values. [00:05:56](https://www.youtube.com/watch?v=hYycPLbaMos&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h05m56s) You can also use the getVar class for your own purposes. At this point we see at least one of the router case within the parse method. In the case loop there's at least one router area that needs to be changed. I know by having looked at this before, that there is more than one, it's also categories. [00:06:25](https://www.youtube.com/watch?v=hYycPLbaMos&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h06m25s) This one should also change(see video), it should be set true because this is a category look up. + +### Another Change To Be Made - Series + +[00:06:38](https://www.youtube.com/watch?v=hYycPLbaMos&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h06m38s) +??? +Now the other place it also need to change is 'series'. 'sermon' should also be 'series' [00:06:43](https://www.youtube.com/watch?v=hYycPLbaMos&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h06m43s) So this is where the guessing which JCB does dynamically did not match the complexity of our Dynamic Gets. I'm sure that as time goes on we might improve it's guessing. We might get better ways of guessing correctly and within the dynamics of the Dynamic Gets, be able to build this case more effectively. but Since we have not done that yet [00:07:17](https://www.youtube.com/watch?v=hYycPLbaMos&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h07m17s) The quickest way for us to resolve this and which most probably be the most Dynamic option Is actually adding a way that you can replace the snippet of code Targeting the specific View So you will never need to really know what is the view When you do this because they are placeholders And you need only remember where you at your dynamic Get So let me go and illustrate this within the JCB interface So all I wanted to show you here is that we are actually targeting with this new Dynamic implementation [00:07:53](https://www.youtube.com/watch?v=hYycPLbaMos&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h07m53s) This little snippet This area here We not replacing the whole method Because really it is it is standard there's not much to do in Improving that and if we do it will be just improving it for everyone And the built function it really works well I haven't seen any issues with that So At the end of the day it seems like only the parse method Needed a bit of an improvement So let's go back to the interface and let me let me show you [00:08:22](https://www.youtube.com/watch?v=hYycPLbaMos&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h08m22s) Where we can make the changes To have the the category render correctly As well as the preacher This one here as well as the series ........... ............ Basically make the changes so that this will say Series And That this one will say true [00:08:48](https://www.youtube.com/watch?v=hYycPLbaMos&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h08m48s) And this one This preacher would also say Preacher That's basically all we need to do and then this router Will work Without any errors Ok So here in the interface you have site views Now the site views the ones who wanna make changes to his this preacher The series and the category now I'm gonna show this to you little bit [00:09:15](https://www.youtube.com/watch?v=hYycPLbaMos&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h09m15s) Long winded but Bear with me It's just make sure everybody is on the same page If you open preacher You would see that it has a dynamic Get called Sermons preacher ID and it say get list query Ok so This is the one We want to change [00:09:35](https://www.youtube.com/watch?v=hYycPLbaMos&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h09m35s) The get the dynamic get As well as speaking about serieses The same is true of that We have this List query get series ID Sermons that we also want to change And so we not changing it in the view The idea was That if we change it in the dynamic get it automatically [00:09:57](https://www.youtube.com/watch?v=hYycPLbaMos&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h09m57s) Right to correct code to whatever view you add it because we've added some custom Scripting Sorry placeholders within the script So let's take the first one is this sermon Where is it Sermon series So in custom script we scroll down to the bottom there is now a new Tab here option here Add PHP Parse method in router little bit of explanation there [00:10:29](https://www.youtube.com/watch?v=hYycPLbaMos&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h10m29s) click yes And it will Dynamically load What is what I can consider the most basic implementation of that little snippet So you see it looks very familiar it's got his place holders And it has a specific It has a specific S View placeholder That's because we're dealing with the site View And it has to have this s in it To replace it with the site view name [00:10:55](https://www.youtube.com/watch?v=hYycPLbaMos&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h10m55s) So wherever this is gonna be used this this Dynamic get This Would be replaced with that specific site view's value Ok that's just to give you a heads up About the place holder and that's what makes it dynamic So that you can use it in any site view and it will automatically write this Because really the the display of the page is actually based on the database request Which is built in the URL by the name of the view As well as the ID of the element And if there are multiple variables being passed [00:11:32](https://www.youtube.com/watch?v=hYycPLbaMos&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h11m32s) To the URL You can obviously update that and Replace multiple values So Here we want to within this one Did the default option here will actually resolve our issue because Remember these two values were not the same JCB's Dynamic build actually changed this value to Sermon instead of [00:11:57](https://www.youtube.com/watch?v=hYycPLbaMos&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h11m57s) Leaving it The same And there is a very good reason For that Usually this would be the correct response but in this case because of complexity I'm not gonna explain It isn't the correct response and so you want these two values to be the same And it is basically the site view's name So we could just save it close this The next one we wanna do is this sermon preacher And it was also [00:12:25](https://www.youtube.com/watch?v=hYycPLbaMos&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h12m25s) Having the same issue basically So we We gonna do the the same kind of Just add the the custom Option To ensure that these two values remain the same And then the last but not least was this category It is also behaving Incorrectly And really it's only because it [00:12:47](https://www.youtube.com/watch?v=hYycPLbaMos&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h12m47s) Didn't detect That this is actually category And that is primarily because it is using the Sermon table To to start instead In the Sermon table We have a joint here too category If you can see there And so it does load the category and [00:13:12](https://www.youtube.com/watch?v=hYycPLbaMos&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h13m12s) the tweak You see that we are actually using This ID And this is a category ID So it should actually go look for the category And build the parse method based on the category And so here We also gonna Just Add [00:13:33](https://www.youtube.com/watch?v=hYycPLbaMos&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h13m33s) A true To this getVar Which tells the getVar method that this is actually a category This this name In effect is actually gonna be ignored Because it's gonna not be looking for this tables value is gonna go to the category table And look for the value there Ok so this will resolve this this issue We can save and close this one [00:13:59](https://www.youtube.com/watch?v=hYycPLbaMos&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h13m59s) So now we have Done some customisation to our router Just by adding those Values to the dynamic get If we compile our components now It will automatically fall back Unto those Values Just install again [00:14:21](https://www.youtube.com/watch?v=hYycPLbaMos&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h14m21s) And now let's go look at the code So we see here That it did exactly what he wanted it added preacher preacher there And this is now Categories is true And We see the series is series And so now at least we know that this actual The router will behave correctly This is the first step of our improvement to the router [00:14:49](https://www.youtube.com/watch?v=hYycPLbaMos&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h14m49s) It seems to me that we already have a very workable Situation and this is really gonna make it too much better There was also the idea of adding some custom scripting into the built Method And we will look at that And I invite You and anyone else too To get involved On this on GitHub just if you know how to improve his even more Then please [00:15:16](https://www.youtube.com/watch?v=hYycPLbaMos&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h15m16s) I get in contact with me and let's let's work together This is so what we've done so far But like an all iterative developing concepts Will continue improving this To the point where it really serves as well And holds up with changes also happening in Joomla itself Ok well thanks for watching