Updated 028 How to change exported values and setup custom import options (markdown)

Amigo 2019-07-06 14:10:52 +02:00
parent 4d58069963
commit d9f63d2416
1 changed files with 2 additions and 2 deletions

@ -25,9 +25,9 @@ This 'getExportdata' method has this extra value called '$_export' set to 'true'
### Admin View - PHP - (GetListQuery)
The custom scripting is done in the 'Editing the Admin View' area. With the Admin View open, go to PHP and then scroll down until the method ' Add PHP (getListQuery - JModellist)' can be seen and then it should be set to 'Yes'. [00:05:43](https://www.youtube.com/watch?v=fau5mZ6naLc&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h05m43s) The code, that is put there, is added both to the 'getListQuery', as well as to 'exportquery'.<<<<<<
The custom scripting is done in the 'Editing the Admin View' area. With the Admin View open, go to PHP and then scroll down until the method ' Add PHP (getListQuery - JModellist)' can be seen and then it should be set to 'Yes'. [00:05:43](https://www.youtube.com/watch?v=fau5mZ6naLc&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h05m43s) The code, that is put there, is added both to the 'getListQuery', as well as to 'exportquery'. If the values need to be changed that had been exported, but not the values that's being shown in the component, it have to be done in the same area. It will be noticed that the same code appears in two distinct places(See video). [00:06:22](https://www.youtube.com/watch?v=fau5mZ6naLc&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h06m22s) If some value needs to be changed, that may be done simply by adding another 'lookup', and add this '$_export=true'. To see where all this '$_export=true' is appearing, go to any List model and search and it may be seen in different places(See video). [00:06:55](https://www.youtube.com/watch?v=fau5mZ6naLc&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h06m55s) <<<<<<<<<<<<<<<<<<<<<<
If you want to change the values that are being exported, but not the values that's being shown in your component, you will be doing it in the same area. So going back here you'd see that it's that's the same code over here that is also added over here. You will see that's the same code. [00:06:22](https://www.youtube.com/watch?v=fau5mZ6naLc&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h06m22s) If you were for example in here(see video), you wanted to change some value, you could do that by simply adding another lookup or something, and you add this export is true. Now to see where all this export = true is appearing. We would go to any list model and we would search and see there it is. [00:06:55](https://www.youtube.com/watch?v=fau5mZ6naLc&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h06m55s) And there it is again. We are now in the getExportdata, we are in the area, where is looking, remember we showed you in the previous tutorial how to add some customisation to your values in the listview, some HTML, well here we are asking if the export set? or is it true? Then Don't do this. Don't add this feature here. [00:07:25](https://www.youtube.com/watch?v=fau5mZ6naLc&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h07m25s) We are avoiding adding this customisation of coloring because we don't wanted to run when we are exporting. We only wanted the values. Again you can see we're using the export values. So those are the places where the export function is coming in to play, and how we can by using this [00:07:53](https://www.youtube.com/watch?v=fau5mZ6naLc&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h07m53s) _export we are able to identify whether it's an export or not. If it is we can make the changes to the values as we like. Then going back to our back end just to show you this(PHP) is the place where we did the query. And this is the place - before the translation fix, decryption. We are checking whether we are doing an export. And so you could literally take that(see video) [00:08:30](https://www.youtube.com/watch?v=fau5mZ6naLc&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h08m30s) and say instead of the exclamation that if the export 'isset' and export is true, then over here do your thing in that area there. That is if you want to change the values before translation or before decryption or if you want to you can do it after that. So after all was done you want to change the values [00:09:18](https://www.youtube.com/watch?v=fau5mZ6naLc&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h09m18s) on an export. Then you can add it there. And that is really as simple as it is. Adding a change to your exported values.
We are now in the getExportdata, we are in the area, where is looking, remember we showed you in the previous tutorial how to add some customisation to your values in the listview, some HTML, well here we are asking if the export set? or is it true? Then Don't do this. Don't add this feature here. [00:07:25](https://www.youtube.com/watch?v=fau5mZ6naLc&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h07m25s) We are avoiding adding this customisation of coloring because we don't wanted to run when we are exporting. We only wanted the values. Again you can see we're using the export values. So those are the places where the export function is coming in to play, and how we can by using this [00:07:53](https://www.youtube.com/watch?v=fau5mZ6naLc&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h07m53s) _export we are able to identify whether it's an export or not. If it is we can make the changes to the values as we like. Then going back to our back end just to show you this(PHP) is the place where we did the query. And this is the place - before the translation fix, decryption. We are checking whether we are doing an export. And so you could literally take that(see video) [00:08:30](https://www.youtube.com/watch?v=fau5mZ6naLc&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h08m30s) and say instead of the exclamation that if the export 'isset' and export is true, then over here do your thing in that area there. That is if you want to change the values before translation or before decryption or if you want to you can do it after that. So after all was done you want to change the values [00:09:18](https://www.youtube.com/watch?v=fau5mZ6naLc&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h09m18s) on an export. Then you can add it there. And that is really as simple as it is. Adding a change to your exported values.
### Import Features Explained