-
-
Notifications
You must be signed in to change notification settings - Fork 178
TIPS: Custom Code
Chris Paschen edited this page Jul 12, 2018
·
22 revisions
Here are some 'tips' when using custom code.
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!!!!
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!!!!
placeholder must be on its own line!
$bar = 'easy';
$foo = 'some code';
/***[INSERT<>$$$$]***/
$var = 4;
/***[/INSERT<>$$$$]***/
$more = 'more some code';
$bar = 'easy';
$foo = 'some code';
/***[INSERTED$$$$]***///*23*/
$var = 4;
/***[/INSERTED$$$$]***/
$more = 'more some code';
$bar = 'easy';
$foo = 'some code';
/***[INSERTED<>$$$$]***///*23*/
$var = 4;
/***[/INSERTED<>$$$$]***/
$more = 'more some code';
placeholder must be on its own line!
$bar = 'easy';
/***[REPLACE<>$$$$]***/
$foo = 'some code changed';
/***[/REPLACE<>$$$$]***/
$more = 'more some code';
$bar = 'easy';
/***[REPLACED$$$$]***//*25*/
$foo = 'some code changed';
/***[/REPLACED$$$$]***/
$more = 'more some code';
$bar = 'easy';
/***[REPLACED<>$$$$]***//*25*/
$foo = 'some code changed';
/***[/REPLACED<>$$$$]***/
$more = 'more some code';
placeholder must be on its own line!
<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>
<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>
<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>
placeholder must be on its own line!
<div class="easy">
<!--[REPLACE<>$$$$]-->
<?php echo '<a href="'.$item->url.'" title="updated url" >'; ?>
<!--[/REPLACE<>$$$$]-->
</div>
<div class="easy">
<!--[REPLACED$$$$]--><!--25-->
<?php echo '<a href="'.$item->url.'" title="updated url" >'; ?>
<!--[/REPLACED$$$$]-->
</div>
<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