Skip to content

027 How to ensure that a field is not escaped when added to list views

Llewellyn van der Merwe edited this page Dec 19, 2018 · 14 revisions

Hi Sometimes one would like to add extra styling like this Or like that To a listview The problem is that by Default All of the fields all of these field values are being escaped And so If you would like to add let's save this this kind of styling 2A Fieldview Let me show you how I did it In the job order at mint View area If you go to PHP There is a method called at PHP get items method before translation fix and So this happens before The translation or The Fixer or the decryption Sorry the translation fix or the Crips of any field This is not the ideal place you usually would add it after that was done but in this case I did it before So basically I am setting up A value That when I wanna use danger when I wanna use warning Simply using The Get date month and modifying it By the danger time and the warning time from the Job tracking Configuration values so this is a configuration feel that I've added to the component and it It's names are warning time and danger time And the default is 3 weeks 1 week And basically this is the day The dates that I would then use I didn't look through the data And when identify Subway data that is actually What are the target I add This Value to it That then in turn turns this red Ok And then the next one Is a check the dates And then depending on its values I again at some HTML value To the the date and I use a custom A method in a helper class call Fancy date Where I convert the Default Sequel date Do better data better looking date 2nd of April or something Ok So The problem is though If you do this And you Compile a component at items go look at it you see that it actually escapes those values and it prints it Out Leica You know like you see it over here It actually prints out That Around The value And that's obviously not what you'd like and the reason why does that Because all values are being escaped Now there is a way to to stop that from being You from happening And that that is really what this tutorial is about To show you how to prevent That is Skyping So the value we have here is to create date As well as the job status So I'm gonna go in I'm still in the The back end of the component Job order And I'm going to go to the fields And then I'm gonna scroll down to that that that you Job status Ok I'm gonna open it Then Having a rope and I can scroll down and even here You see that there It doesn't show up here sorry I should actually had it but the real That is where the bottom you see I added this little line I said escape Equals False So you were simply add this line And then when component Builder compiles It will actually in the body Of the component where that field is loaded It will we will tell the Escape method not to escape it So that it would rain Display the html instead of printing it out So that is really what it's all about maybe it's Got a lot of explanation for such a simple thing But I can tell you what if you can't do that it's quite frustrating because Sometimes you would like to give some indication with some HTML On the value and then this Feature actually allows that like you could see here We were able to add a nice button around these dates And as well as adding some colour to to these words here and yeah So that is a quick demonstration of how to make use of the not escape Method or concept When it comes to list views around the field values Hope that makes sense You have any questions please don't hesitate to let me know And Until next time take care thanks for watching

Clone this wiki locally