-
-
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
00:00:00 (Click on these time links to see Youtube video)
There is occasionally a need to add extra styling to a List View. 00:00:06 The problem though is that all of these field values are being escaped by default. How is this kind of styling added to a field?
In the Job Order Admin View area, in PHP, there is a method called 'Add PHP(getitems Method - before translation fix & decryption)'. It must happen before the translation fix or the decryption of any field. This is not the ideal place.
Usually this would be added after the above was done, but in this case, it was done before. 00:01:15 A value is set up when 'danger' or 'warning' has to be applied 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. Its names are: 'warning time' and 'danger time' where the default is three weeks, one week. These are the dates that will be used.
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 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 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 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'.
In the back end of the component, 'Job order', the area called 'Fields' can be opened. Scroll down to 'Job status'. 00:04:09 At the bottom this line, 'escape= "false"', had been added. Add this line: 'escape= "false"'. 00:04:37 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 This was a quick demonstration of how to make use of the not escape method.
- 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