Page:
TIPS: Custom Code
Pages
001 Hello World with Joomla Component Builder
002 Intro to JCB
003 Installation of JCB
004 General Planning
005 Field Types
006 Basic Fields
007 Admin Views
008 Advanced Fields
009 Adding Admin Views to a Component
010 Component Settings
011 Component Scripts
012 Component FTP and more
013 dynamicGet
014 Adding dynamicGet to a Site View
015 Adding Templates and Layouts to a Site View
016 Template Setup
017 Layout Setup
018 Custom Admin Views
019 Adding Site Views to a Component
020 Adding Custom Admin Views to a Component
021 Tweaking MySQL Demo Data
022 Global Settings of Component Builder
023 Adding a custom time field
024 How to integrate the Create User Helper Method in your Components
025 How to use email helper in your components
026 How to setup a store message method along side the email helper class
027 How to ensure that a field is not escaped when added to list views
028 How to change exported values and setup custom import options
029 How to overwrite the custom fields
030 How to filter a list field based on association with another field
031 Automatic import of custom code during compilation in JCB
032 JCB manual custom code implementation
033 Export Import of fully mapped components
034 How to add Custom Buttons in JCB to your component Admin Area
035 Translation Mananger in JCB explained
036 Setting Site View Permission
037 Auto create SQL updates for Componets in JCB
038 Setup Site Edit View in JCB
039 Automated backup system in JCB
040 Adding Helper Structures to any JCB component
041 Upgrade to JCB v2.5.8 and using the new Admin View and Admin Fields
042 How to setup tabs after upgrade to v2.5.8 in JCB
043 Major Release of JCB v2.6.0
044 Hello World Component with Joomla Component Builder Creator Extended
045 Adding your own rule validation to a field in JCB
046 General overview of how community snippets work
047 Tutorial on forking JCB snippets so you can share your snippets with the rest of the Community
048 Tutorial on making a pull request at Joomla Component Builder Snippets
049 The New Library Manager Area
050 Easy Translation via excel
051 Dynamic Router Implementation Explained
052 Automated database updates in Joomla during development of a component
053 Quick Subform Demonstration
054 VDM Package Import Option
055 Dynamic File and Folder Inclusion concept
056 How to use the file field type to upload a file in JCB
057 Drag and Drop Upload functionality in JCB
058 The Quick Hello Word with JCB
059 Adding none database fields to an admin view
060 The custom dashboard option in JCB
061 Add or Remove Prefix to Component Name in Joomla Menu
062 Add your own JCB packages to the JCB Communty Directory
063 Proposed Collaborative Workflow in JCB
064 How to install jcb packages
065 JAB18 Using Joomla Component Builder
066 The new fields Area to make things easier
067 Adding Language String to your Component and get the Language Placeholder for dynamic use
068 Library Manager Anticipated Functionality
069 Join Fields in the admin list view with field relations
070 How to change the License Template in JCB
071 Reuse Custom Code
072 Setup Local Development Environment with Bitnami
073 JCB Fields Type Extended
074 How to add Joomla Custom Fields
075 Expand Custom Field Type Beyond The Default
076 A Quick Demonstration to Load a List of Items in a Site View
077 Run Expansion Explained
078 How to Add a Form to a Site View
079 Update the Site Form Field via URL Parameter
080 How to Add More Helper Methods to Your Components Helper Class
081 Easy Validation Rules for Fields in JCB
082 New Placeholders Feature
083 Manage a Components Global Config Option Field in Relation With Menu Params
084 Default Database Values can be set per Field Type
Beta Testing
Component Settings
Develop a Joomla Component Guide to use the Component Builder
Developing with Joomla Component Builder
Home
PHP Settings
TIPS: Custom Code
Using the JCB Demo Component While Building Your Local Development System
0
TIPS: Custom Code
Chris Paschen edited this page 2018-07-12 11:43:27 -05:00
Here are some 'tips' when using custom code.
The custom PHP script placeholders
USAGE | PHP START | PHP END |
---|---|---|
New Insert Code |
/***[INSERT<>$$$$]***/ |
/***[/INSERT<>$$$$]***/ |
New Replace Code |
/***[REPLACE<>$$$$]***/ |
/***[/REPLACE<>$$$$]***/ |
WHEN JCB ADDS IT BACK AGAIN | ||
Existing Inserted Code |
/***[INSERTED$$$$]***//*23*/ |
/***[/INSERTED$$$$]***/ |
Existing Replaced Code |
/***[REPLACED$$$$]***//*25*/ |
/***[/REPLACED$$$$]***/ |
CHANGING EXISTING CUSTOM CODE | ||
Update Inserted Code |
/***[INSERTED<>$$$$]***//*23*/ |
/***[/INSERTED<>$$$$]***/ |
Update Replaced Code |
/***[REPLACED<>$$$$]***//*25*/ |
/***[/REPLACED<>$$$$]***/ |
"
/*23*/
" and "/*25*/
" (or similar id numbers) are the ID of the code in the system don't change it!!!!
The custom HTML script placeholders
USAGE | HTML START | HTML END |
---|---|---|
New Insert Code |
<!--[INSERT<>$$$$]--> |
<!--[/INSERT<>$$$$]--> |
New Replace Code |
<!--[REPLACE<>$$$$]--> |
<!--[/REPLACE<>$$$$]--> |
WHEN JCB ADDS IT BACK AGAIN | ||
Existing Inserted Code |
<!--[INSERTED$$$$]--><!--23--> |
<!--[/INSERTED$$$$]--> |
Existing Replaced Code |
<!--[REPLACED$$$$]--><!--25--> |
<!--[/REPLACED$$$$]--> |
CHANGING EXISTING CUSTOM CODE | ||
Update Inserted Code |
<!--[INSERTED<>$$$$]--><!--23--> |
<!--[/INSERTED<>$$$$]--> |
Update Replaced Code |
<!--[REPLACED<>$$$$]--><!--25--> |
<!--[/REPLACED<>$$$$]--> |
"
<!--23-->
" and "<!--25-->
" (or similar id numbers) are the ID of the code in the system don't change it!!!!
Insert Examples (PHP)
placeholder must be on its own line!
New PHP Insert Code
$bar = 'easy';
$foo = 'some code';
/***[INSERT<>$$$$]***/
$var = 4;
/***[/INSERT<>$$$$]***/
$more = 'more some code';
Existing PHP Insert Code
$bar = 'easy';
$foo = 'some code';
/***[INSERTED$$$$]***///*23*/
$var = 4;
/***[/INSERTED$$$$]***/
$more = 'more some code';
Update PHP Insert Code
$bar = 'easy';
$foo = 'some code';
/***[INSERTED<>$$$$]***///*23*/
$var = 4;
/***[/INSERTED<>$$$$]***/
$more = 'more some code';
Replace Examples (PHP)
placeholder must be on its own line!
New PHP Replace Code
$bar = 'easy';
/***[REPLACE<>$$$$]***/
$foo = 'some code changed';
/***[/REPLACE<>$$$$]***/
$more = 'more some code';
Existing PHP Replace Code
$bar = 'easy';
/***[REPLACED$$$$]***//*25*/
$foo = 'some code changed';
/***[/REPLACED$$$$]***/
$more = 'more some code';
Update PHP Replace Code
$bar = 'easy';
/***[REPLACED<>$$$$]***//*25*/
$foo = 'some code changed';
/***[/REPLACED<>$$$$]***/
$more = 'more some code';
Insert Examples (HTML)
placeholder must be on its own line!
New HTML Insert Code
<div class="easy">
<?php echo '<a href="'.$item->url.'" title="url" >'; ?>
<!--[INSERT<>$$$$]--><!--23-->
<?php echo '<a href="'.$item->new_url.'" title="new url" >'; ?>
<!--[/INSERT<>$$$$]-->
</div>
Existing HTML Insert Code
<div class="easy">
<?php echo '<a href="'.$item->url.'" title="url" >'; ?>
<!--[INSERTED$$$$]--><!--23-->
<?php echo '<a href="'.$item->new_url.'" title="new url" >'; ?>
<!--[/INSERTED$$$$]-->
</div>
Update HTML Insert Code
<div class="easy">
<?php echo '<a href="'.$item->url.'" title="url" >'; ?>
<!--[INSERTED<>$$$$]--><!--23-->
<?php echo '<a href="'.$item->new_url.'" title="new url" >'; ?>
<!--[/INSERTED<>$$$$]-->
</div>
Replace Examples (HTML)
placeholder must be on its own line!
New HTML Replace Code
<div class="easy">
<!--[REPLACE<>$$$$]-->
<?php echo '<a href="'.$item->url.'" title="updated url" >'; ?>
<!--[/REPLACE<>$$$$]-->
</div>
Existing HTML Replaced Code
<div class="easy">
<!--[REPLACED$$$$]--><!--25-->
<?php echo '<a href="'.$item->url.'" title="updated url" >'; ?>
<!--[/REPLACED$$$$]-->
</div>
Update HTML Replaced Code
<div class="easy">
<!--[REPLACED<>$$$$]--><!--25-->
<?php echo '<a href="'.$item->url.'" title="updated url" >'; ?>
<!--[/REPLACED<>$$$$]-->
</div>
- 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