๐งฉ Architecture & Core Logic
- Super Powers
- Joomla Powers
- Compile Native Components, Plugins & Modules
- Multi-Version Support
- Conditional Logic Injection
- Reusable Admin Views
- Dynamic GET Builder
- Round-Trip Code Integration
- Custom Admin Views
- Site Views
- Dynamic Dashboards
- Model Linking Between Views
- Shared Field Reuse Across Views
- Drag & Drop Field Mapping
- Dynamic Field Visibility
- Independent Packaging
๐ Joomla CMS Integration
๐งฑ Custom Code System (Powerful Dual Feature)
๐ Field Type System
๐ Snippets, Templates, Layouts, Libraries
- Snippets Reusable Html Blocks
- Layouts Reusable Php Render Templates
- Templates Page Level Views Linked To Custom Admin Site Views
- Libraries JS CSS Assets Linked To UI
- CDN Local Toggle For Library Delivery
- Media Folder Injection With Override Support
- Repository Push Pull Reset Workflow
- Init Snippets Layouts Templates Via Gui
๐ฆ Packages
๐งฉ Architecture & Core Logic
๐ File & Code Management
๐ง Code Reuse & Blueprints
๐ Joomla CMS Integration
๐จ Visual GUI & UX
๐ Internationalization
๐ฆ Packaging & Distribution
โ๏ธ Compiler Engine Features
๐งฑ Custom Code System
๐ Field Type System
๐ Dynamic GET (Visual SQL Engine)
๐ Snippets, Templates, Layouts, Libraries
๐ Documentation & Metadata
๐ Analytics & Insights
๐งฉ Architecture & Core Logic
- Super Powers
- Joomla Powers
- Compile Native Components, Plugins & Modules
- Multi-Version Support
- Conditional Logic Injection
- Reusable Admin Views
- Dynamic GET Builder
- Round-Trip Code Integration
- Custom Admin Views
- Site Views
- Dynamic Dashboards
- Model Linking Between Views
- Shared Field Reuse Across Views
- Drag & Drop Field Mapping
- Dynamic Field Visibility
- Independent Packaging
๐ Joomla CMS Integration
- Token Integration
- ACL Per View, Field, Item
- Field-Based Joomla Config Generation
- Support For Joomla Categories/Tags/Custom Fields
- CLI-Ready Components
- Joomla Update Server Integration
- Version-Aware Language String Compilation
- Remote Publishing to Custom Repo Update Streams
๐ Field Type System
- Field Types Define Templates And Data Types
- Gui Defined Rules Required Unique Nullable
- Save Get Hooks Per Field
- Database Schema Auto Generated From Field Settings
- Per Display Field Rendering Config List Edit
- Create Dynamic Models With Modals Selectors
- Conditional Js And Css Per Field
๐ Snippets, Templates, Layouts, Libraries
- Snippets Reusable Html Blocks
- Layouts Reusable Php Render Templates
- Templates Page Level Views Linked To Custom Admin Site Views
- Libraries JS CSS Assets Linked To UI
- CDN Local Toggle For Library Delivery
- Media Folder Injection With Override Support
- Repository Push Pull Reset Workflow
- Init Snippets Layouts Templates Via Gui
PHP & HTML Custom Code Injection
Write once โ inject anywhere. Gain total control over logic, layout, and rendering. What Is Custom Code Injection in JCB?
What Is Custom Code Injection in JCB?
JCB allows developers to define and inject reusable PHP and HTML code blocks throughout their components. Whether you need a custom helper function, a data transformation routine, a special HTML layout block, or a form override โ JCB provides structured ways to store and re-use custom logic via its Custom Code system and tag-based injection.
Unlike Insert/Replace tags, which preserve code in compiled files, the Custom Code system lets you manage your code blocks directly in the JCB interface. These blocks are injected during the compilation process at specific tagged locations, ensuring that your logic is inserted where and how you want it, every time.
Key Features
- ๐ง GUI-Managed Code Blocks: Define PHP or HTML/JS code blocks inside JCBโs โCustom Codeโ manager. Tag them with a unique name (key) and organize by context (view, field, layout, etc.).
- ๐ Key-Based Injection: Inject code blocks into any part of a view, model, layout, or field using smart placeholders like:
[CUSTOMCODE=getCustom]
- ๐ Central Reuse: Write code once and inject it in multiple places. Great for repeating logic like formatting, access checks, reusable layouts, etc.
- โ๏ธ Context-Aware Output: Custom code can vary its behavior depending on whether itโs injected in admin/site, item/list views, frontend/backend, or field get/save.
- ๐งฉ Field, View, and Layout Support: Inject logic at the field level (e.g. save hooks), inside templates or snippets, or within model/controller files.
- ๐ Track Usage & Tags: JCB tracks where each custom code block is used, making debugging and refactoring easier.
- ๐ Compiler-Safe: Injected code is written only at compile time. You donโt manually edit the compiled file โ JCB controls the logic insertion safely.
- ๐ Supports PHP, HTML, JavaScript: Choose your syntax and apply it based on the type of output โ render views, backend logic, AJAX handling, UI markup, or inline event handling.
Use Cases
- Inject PHP logic into a modelโs save method for preprocessing or validation
- Add a reusable HTML snippet to multiple layouts (e.g. โPowered byโ footer)
- Define a JavaScript callback block for a dynamic field
- Wrap a view with a conditional rendering check
- Create a library of formatting helpers or partial views
- Store a site-wide notice block and include it across views
How to Use in JCB
- Navigate to Components โ Custom Code
- Create a new Custom Code block
- Name it (e.g.
renderPriceWithDiscount
) - Select type: PHP, HTML, or JS
- Write your code
- Name it (e.g.
- In the context (view, layout, template, snippet, field):
- Use
[CUSTOMCODE=renderPriceWithDiscount]
- Use
- Compile your component โ your code is now injected wherever itโs tagged.
๐ง Pro Tip: Use naming conventions like renderPriceWithDiscount
(e.g. getAdminAccess
) to stay organized in large projects.
Conclusion
JCBโs Custom Code Injection system empowers you to keep logic modular, reusable, and centralized. Whether you're a developer building advanced workflows or a team managing multiple components, this feature ensures that you never write the same code twice โ and that every block is injected with precision and safety during compile.