Creating a new Table #

When you create a new table in the Custom Tables extension, a corresponding table is automatically created in your MySQL or PostgreSQL database. This means that Custom Tables does not rely on virtual structures or JSON-based storage; instead, it works with real, fully functional database tables that can be accessed, queried, and modified just like any other table in your database.
Database Table Structure #
The name of the newly created table follows this format:
#__customtables_table_<table-name>
For example, if you create a table named Contacts, the actual database table will be:
#__customtables_table_contacts
where #__
represents your database prefix, ensuring compatibility with Joomla’s database structure.
This means that your data is directly stored in the database, making it accessible for advanced SQL queries, reporting, or external system integrations.
You can also retrieve the table’s metadata within a layout using the following tags:
- Table Name:
{{ table.name }}
– Retrieves the internal database name. - Table Title:
{{ table.title }}
– Retrieves the display name used in the Custom Tables interface.
Expanding Field Types #
Custom Tables extends MySQL functionality by expanding the list of available field types beyond the default MySQL fields. The Pro version of the extension further enhances this by allowing:
- Custom Field Types such as Image, Geolocation, Virtual Fields, and more.
- Enhanced Relationships for linking to other tables, creating Table Joins – lookups.
- Flexible Data Handling including automatic indexing, validation, and search capabilities.
Linking to Existing Tables
With the Pro version, you can also link Custom Tables to existing third-party database tables instead of creating a new one. This is useful when integrating with external systems while still leveraging the flexibility of the Custom Tables UI and features.
Advanced Settings #
The Advanced tab in the Custom Tables extension / plugin offers a powerful set of configurations that allow developers to fine-tune how tables interact with the database. Let’s break down these advanced settings and their impact.

Third-Party Table #
- Allows linking to an existing database table rather than creating a new one.
- Essential for integrating with third-party systems while using Custom Tables’ interface and extended field types.
Primary Key Field #
- Defines the primary key field for the table.
- Defaults to
id
, but this can be customized for tables with different key naming conventions. - Ensures correct indexing and record identification.
Primary Key Field Type #
- Determines how the primary key field is created in the database.
- Defaults to
AUTO_INCREMENT
for MySQL, but supports any valid SQL type and constraints. - This level of control allows for optimized database performance and compatibility.
Primary Key Generation Pattern #
- A powerful feature for creating custom primary key patterns.
- Supports Twig syntax, enabling dynamic key formats beyond just sequential IDs.
- Examples include timestamps, random values, or hash-based IDs for added uniqueness and security.
Field Name Prefix #
- Helps avoid conflicts with MySQL reserved words.
- Customizable to fit a specific naming convention.
- Setting to
NO-PREFIX
removes the prefix, but changing this setting doesn’t automatically rename existing fields—manual intervention is required.
Why These Advanced Settings Matter #
- Database Integrity: By customizing primary keys, field types, and prefixes, you ensure that your database schema adheres to best practices and remains compatible with Joomla / WordPress and third-party applications.
- Flexibility: Linking to existing tables means you can incorporate external data sources seamlessly without duplicating data.
- Unique Data Patterns: Custom primary key generation patterns offer creative solutions for identifying records, adding an extra layer of control and uniqueness.
By mastering these advanced settings, Custom Tables becomes more than a Joomla extension—it turns into a dynamic data management tool that can meet the most demanding project requirements.
Third-party tables #

Leave a Reply
You must be logged in to post a comment.