Updated 051 Dynamic Router Implementation Explained (markdown)
parent
bf6fd658a2
commit
ebf000af5c
@ -5,13 +5,18 @@
|
||||
[00:00:00](https://www.youtube.com/watch?v=hYycPLbaMos&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h00m00s)
|
||||
(_Click on these time links to see Youtube video_)
|
||||
|
||||
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.
|
||||
I would like to demonstrate the new implementation which is not such a major thing but something we have done to deal with some of the router complexity. If a component is built and has a front end for your component, and you have Site Views. [00:00:17](https://www.youtube.com/watch?v=hYycPLbaMos&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h00m17s) Your Site Views usually are getting its 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 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.
|
||||
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 on 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
|
||||
|
||||
@ -23,56 +28,56 @@ I'm just going to show you the code. When you look at the website you've got you
|
||||
|
||||
[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.
|
||||
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.
|
||||
If we look at preachers, which is a listview. Let's open the model, preacher.php. Here are 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 a 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.
|
||||
Whereas 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.
|
||||
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 lookup.
|
||||
|
||||
### 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 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. 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 adding a way that you can replace the snippet of code, targeting the specific view. You will never need to really know what is the view when you do this because they are placeholders. You need only to remember where you add your Dynamic Get.
|
||||
Now the other place also needs 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. 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 adding a way that you can replace the snippet of code, targeting the specific view. You will never need to really know what is the view when you do this because they are placeholders. You need only to remember where you add your Dynamic Get.
|
||||
|
||||
Let me go and illustrate this within the JCB interface. All I wanted to show you here is that we are 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 little area(see video). We are not replacing the whole method, because it is standard, there's not much to do in improving that, and if we do, it will be improving it for everyone. The build function is really working well. I haven't seen any issues with that. At the end of the day it seems like only the parse method needed a bit of an improvement.
|
||||
Let me go and illustrate this within the JCB interface. All I wanted to show you here is that we are 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 little area(see video). We are not replacing the whole method, because it is standard, there's not much to do in improving that, and if we do, it will be improving it for everyone. The build function is really working well. I haven't seen any issues with that. At the end of the day, it seems like only the parse method needed a bit of an improvement.
|
||||
|
||||
### The Interface Where You Can Make Changes In Dynamic Gets
|
||||
|
||||
[00:08:19](https://www.youtube.com/watch?v=hYycPLbaMos&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h08m19s)
|
||||
|
||||
Let's go back to the interface and let me show you where we can make the changes to have the category render correctly. As well as the preacher and the series. Basically make the changes so that sermon will say series, and this one will say true, [00:08:48](https://www.youtube.com/watch?v=hYycPLbaMos&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h08m48s) and this one preacher would also say preacher. That's basically all we need to do and then this router will work without any errors. Here in the interface you have Site Views. The Site Views, the ones we want to make changes to his this preacher, the series and the category. I'm going to 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 to 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 is a (getListQuery). This is the one we want to change. [00:09:35](https://www.youtube.com/watch?v=hYycPLbaMos&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h09m35s) The Dynamic Get, as well as speaking about serieses, the same is true of that. We have this Sermons (series id) (getListQuery) that we also want to change. We do not change 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) write the correct code to whatever view you add it, because we've added some Custom Placeholders within the script.
|
||||
Let's go back to the interface and let me show you where we can make the changes to have the category render correctly. As well as the preacher and the series. Basically, make the changes so that sermon will say series, and this one will say true, [00:08:48](https://www.youtube.com/watch?v=hYycPLbaMos&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h08m48s) and this one preacher would also say preacher. That's basically all we need to do and then this router will work without any errors. Here in the interface, you have Site Views. The Site Views, the ones we want to make changes to his this preacher, the series and the category. I'm going to show this to you a 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 to 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 is a (getListQuery). This is the one we want to change. [00:09:35](https://www.youtube.com/watch?v=hYycPLbaMos&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h09m35s) The Dynamic Get, as well as speaking about series', the same is true of that. We have this Sermons (series id) (getListQuery) that we also want to change. We do not change 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) write the correct code to whatever view you add it because we've added some Custom Placeholders within the script.
|
||||
|
||||
### Sermon (series id) - Heads Up For Placeholders
|
||||
|
||||
[00:10:06](https://www.youtube.com/watch?v=hYycPLbaMos&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h10m06s)
|
||||
|
||||
Let's take the first one is Sermon (series id). In Custom Script we scroll down to the bottom, there is a new tab option here, Add PHP (parse Method)-in Router'. [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. You will see it looks very familiar it's got this placeholders. It has a specific sview 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 going to be used, this Dynamic Get would be replaced with that specific site view's value. That's just to give you a heads up about the placeholder and that's what makes it dynamic, that you can use it in any site view and it will automatically write this. Because the display of the page is 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. 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 update that and replace multiple values. Here we want to within this one, the default option here will resolve our issue because remember these two values were not the same.
|
||||
Let's take the first one is Sermon (series id). In Custom Script we scroll down to the bottom, there is a new tab option here, Add PHP (parse Method)-in Router'. [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. You will see it looks very familiar it's got these placeholders. It has a specific sview 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 going to be used, this Dynamic Get would be replaced with that specific site view's value. That's just to give you a heads up about the placeholder and that's what makes it dynamic, that you can use it in any site view and it will automatically write this. Because the display of the page is 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. 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 update that and replace multiple values. Here we want to within this one, the default option here will resolve our issue because remember these two values were not the same.
|
||||
|
||||
### JCB Change sview to sermon
|
||||
|
||||
[00:11:56](https://www.youtube.com/watch?v=hYycPLbaMos&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h11m56s)
|
||||
|
||||
JCB's dynamic build changed sview value to sermon instead of leaving it the same. 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 going to explain it, isn't the correct response and so you want these two values to be the same and it is the site view's name. We could just save it close.
|
||||
JCB's dynamic build changed sview value to sermon instead of leaving it the same. 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 going to explain it, isn't the correct response and so you want these two values to be the same and it is the site view's name. We could just save it close.
|
||||
|
||||
### Sermon (Preacher id)
|
||||
|
||||
The next one we want to do is Sermon (Preacher id). It was also [00:12:25](https://www.youtube.com/watch?v=hYycPLbaMos&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h12m25s) having the same issue. We are going to do the the same kind of just add the the custom option to ensure that these two values remain the same.
|
||||
The next one we want to do is Sermon (Preacher id). It was also [00:12:25](https://www.youtube.com/watch?v=hYycPLbaMos&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h12m25s) having the same issue. We are going to do the same kind of just add the the custom option to ensure that these two values remain the same.
|
||||
|
||||
### Resolving Category
|
||||
|
||||
[00:10:39](https://www.youtube.com/watch?v=hYycPLbaMos&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h10m39s)
|
||||
|
||||
Then the last but not least was this category. It is also behaving incorrectly and 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 category. That is primarily because it is using the Sermon table to start instead in the Sermon table we have a Joint here to category it does load the category. [00:13:12](https://www.youtube.com/watch?v=hYycPLbaMos&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h13m12s) In the Tweak you will see that we are using JRequest ID, and this is a category ID. It should go look for the category, and build the parse method based on the category. In Custom Script we are also going to 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 a category. This name in effect is going to be ignored. Because it's not going to look for this tables value, it is going to the category table and look for the value there. This will resolve this issue. We can save and close. [00:13:59](https://www.youtube.com/watch?v=hYycPLbaMos&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h13m59s)
|
||||
Then last but not least was this category. It is also behaving incorrectly and 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 a category. That is primarily because it is using the Sermon table to start instead in the Sermon table we have a Joint here to category it does load the category. [00:13:12](https://www.youtube.com/watch?v=hYycPLbaMos&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h13m12s) In the Tweak you will see that we are using JRequest ID, and this is a category ID. It should go look for the category and build the parse method based on the category. In Custom Script we are also going to 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 a category. This name in effect is going to be ignored. Because it's not going to look for the value of this table, it is going to the category table and look for the value there. This will resolve this issue. We can save and close. [00:13:59](https://www.youtube.com/watch?v=hYycPLbaMos&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h13m59s)
|
||||
|
||||
Now we have done some customization to our Router just by adding those values to the Dynamic Get. If we compile our component 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) Let's go look at the code. We see here that it did exactly what we wanted, it added preacher, preacher there. This categories is true, and we see the series is series. At least we know that 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 going to make it so much better. There was also the idea of adding some custom scripting into the built method. We will look at that and I invite you and anyone else to get involved on this on GitHub. 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) get in contact with me and let's work together. This is what we've done so far. But like an all iterative developing concepts we will continue improving this to the point where it really serves as well and holds up with changes also happening in Joomla itself.
|
||||
Now we have done some customization to our Router just by adding those values to the Dynamic Get. If we compile our component now, it will automatically fall back to those values. Just install it again. [00:14:21](https://www.youtube.com/watch?v=hYycPLbaMos&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h14m21s) Let's go look at the code. We see here that it did exactly what we wanted, it added preacher, preacher there. This categories is true, and we see the series is series. At least we know that 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 going to make it so much better. There was also the idea of adding some custom scripting into the built method. We will look at that and I invite you and anyone else to get involved on this on GitHub. 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) get in contact with me and let's work together. This is what we've done so far. But like an alliterative developing concepts we will continue improving this to the point where it really serves as well and holds up with changes also happening in Joomla itself.
|
Loading…
Reference in New Issue
Block a user