-
-
Notifications
You must be signed in to change notification settings - Fork 178
027 How to ensure that a field is not escaped when added to list views
Occationally there is a need to add extra styling to a List View Hi. Sometimes one would like to add extra styling like this 00:00:06 The problem though is that by default all of these field values are being escaped.
How is this kind of styling added to a field?
In the Job Order Admin View area, in PHP, 00:00:39 there is a method called 'Add PHP(getitems Method - before translation fix & decryption)'. This happens before the translation fix or the decryption of any field. This is not the ideal place.
Usually this would be added after that was done, but in this case it was done before. 00:01:15 A value is set up when 'danger' or 'warning' need to be applied, simply by using the getDate and modifying it by the danger time and the warning time from the job tracking configuration values. This is a configuration field that has been added to the component and it's names are: 'warning time' and 'danger time' where the default is 3 weeks, 1 week. This is the dates that is going to be used.<<<<<<<<<<<<<<<<<<<<<<<<<
I then look through the data and when I identify 00:01:49 data that is actually part of the target. I add this value to it. That then intern turns this red. The next one is I check the dates. Depending on its values I again add some HTML value 00:02:19 to the date, and I use a custom method in a helper class call fancyDate, where I convert the default sequel date to a better date or a better looking date, 2nd of April or something. The problem is though, 00:02:39 if you do this and you compile your component, add items, go look at it, you'd see that it actually escapes those values and it prints it out like you see it over here. It prints out that around the value(see video). 00:02:59
That's obviously not what you'd like and the reason why it does that, because all values are being escaped. Now there is a way to stop that from being from happening. That is really what this tutorial is about. To show you how to prevent that escaping. The value we have here is to create date, as well as the job status. I'm going to go in, I'm still in the 00:03:31 back end of the component, Job order.
And I'm going to go to the fields, I'm going to scroll down to Job status. I'm going to open it. While I having it open and I can scroll down 00:04:09 way at the bottom you see I added this little line escape= "false". So you would simply add this line. When component builder compiles, in the body of the component where that field is loaded, it will tell the escape method not to escape it, 00:04:37 that it would then display the html instead of printing it out. That is really what it's all about. Maybe it have 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 upon the value, 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 these words. 00:05:15 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. If you have any questions please don't hesitate to let me know.
- Home
- Beta Testing
- Custom Code
- PHP Settings
- Demo Component
-
Tutorials
- Hello World JCB
- Intro JCB Guide
- JCB Installation Steps
- Planning Components
- Field Type Overview
- Basic Fields Creation
- Admin View Management
- Advanced Field Usage
- Admin Component Integration
- Component Setting Customization
- Scripting Components
- Component FTP Options
- Dynamic Get Method
- Site View DynamicGet
- Site View Templates
- Template Setup Guide
- Layout Configuration Steps
- Custom Admin Management
- Adding Site Views
- Custom Admin Integration
- MySQL Demo Tweaking
- Global JCB Settings
- Custom Time Field
- User Helper Integration
- Email Helper Usage
- Message Store Email
- List View Unescape
- Export Import Customization
- Overwrite Custom Fields
- List Field Filtering
- Automatic Code Import
- Manual Code Implementation
- Component Export Import
- Custom Admin Buttons
- Translation Management
- Site View Permissions
- Component SQL Updates
- Site Edit Configuration
- JCB Backup System
- Helper Structure Integration
- JCB v2.5 Upgrade
- Tab Setup Guide
- JCB v2.6 Release
- Extended HelloWorld
- Field Rule Validation
- Community Snippets Intro
- Snippet Forking Tutorial
- Pull Request Snippets
- Library Manager Area
- Excel-based Translation
- Dynamic Router Details
- Database Auto Updates
- Subform Quick Demo
- VDM Package Import
- Dynamic File Inclusion
- File Field Upload
- Drag-n-Drop Upload
- Quick HelloWorld JCB
- Non-database Fields
- Dashboard Customization
- Menu Prefix Toggle
- Community JCB Packages
- Collaborative JCB Workflow
- JCB Package Install
- JCB JAB18 Event
- Convenient New Fields
- Component Language Strings
- Library Functionality Anticipation
- Join Field Relations
- License Template Change
- Code Reusability
- Local Dev Environment
- Extended Field Types
- Joomla Custom Fields
- Custom Field Expansion
- Site View Listing
- Run Expansion Method
- Form Site View
- Field URL Update
- Additional Helper Methods
- Field Validation Rules
- New Placeholder Feature
- Component Config Params
- Per-field Default Values