Updated 027 How to ensure that a field is not escaped when added to list views (markdown)

Amigo 2019-08-08 17:17:48 +02:00
parent 45d2c2b594
commit be5122391e

@ -24,10 +24,11 @@ Usually this would be added after the above was done, but in this case it was do
[00:01:44](https://www.youtube.com/watch?v=bfl0l3AoLKU&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h01m44s)
Look through the data and identify data that is part of the target. Add this value to it, which in turn turns this red. (See video.) [00:02:19](https://www.youtube.com/watch?v=bfl0l3AoLKU&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h02m19s) Check the dates and, depending on its values, add HTML value to the date. Use a custom method in a Helper Class called 'fancyDate', where the default sequel date is converted to a more appropriate date, 2nd of April etc. [00:02:39](https://www.youtube.com/watch?v=bfl0l3AoLKU&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h02m39s) However, the problem is that if this is done and the component is compiled and items added , it escapes those values and prints it around the value. (See video.) [00:00:39](https://www.youtube.com/watchv=bfl0l3AoLKU&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h02m59s) Obviously that is not the desired outcome. There is a way to prevent it. The value here is to create 'date', as well as the 'job status'.
Look through the data and identify data that is part of the target. Add this value to it, which in turn turns this red. (See video.) [00:02:19](https://www.youtube.com/watch?v=bfl0l3AoLKU&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h02m19s) Check the dates and, depending on its values, add HTML value to the date. Use a custom method in a Helper Class called 'fancyDate', where the default sequel date is converted to a more appropriate date, 2nd of April etc. [00:02:39](https://www.youtube.com/watch?v=bfl0l3AoLKU&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h02m39s) However, the problem is that if this is done and the component is compiled and items added , it escapes those values and prints it around the value. (See video.) [00:00:39](https://www.youtube.com/watchv=bfl0l3AoLKU&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h02m59s) Obviously that is not the desired outcome. There is a way to prevent it. The value here is to create 'date' as well as the 'job status'.
### Field Adding Escape=False To Code to Prevent Escape
[00:03:27](https://www.youtube.com/watch?v=bfl0l3AoLKU&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h03m27s)
In the back end of the component, 'Job order', the area called 'Fields' can be opened. Scroll down to 'Job status'. [00:04:09](https://www.youtube.com/watch?v=bfl0l3AoLKU&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h04m09s) Scroll further down and at the bottom it can be seen that this line 'escape= "false"' had been added. So you would simply add this line: 'escape= "false"' [00:04:37](https://www.youtube.com/watch?v=bfl0l3AoLKU&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h04m37s) In the structure of the component where that field is loaded, Component Builder as it compiles, will command the escape method not to escape it, and consequently the HTML will be displayed instead of it being printed out. [00:05:15](https://www.youtube.com/watch?v=bfl0l3AoLKU&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h05m15s) This has been a quick demonstration of how to make use of the not escape method.
In the back end of the component, 'Job order', the area called 'Fields' can be opened. Scroll down to 'Job status'. [00:04:09](https://www.youtube.com/watch?v=bfl0l3AoLKU&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h04m09s) At the bottom this line, 'escape= "false"', had been added. Add this line: 'escape= "false"'. [00:04:37](https://www.youtube.com/watch?v=bfl0l3AoLKU&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h04m37s) In the structure of the component where that field is loaded, Component Builder, as it compiles, will command the escape method not to escape it, and consequently the HTML will be displayed instead of it being printed out. [00:05:15](https://www.youtube.com/watch?v=bfl0l3AoLKU&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h05m15s)
This was a quick demonstration of how to make use of the not escape method.