JP CS Data Query
Article Index
- JP CS Data Query
- Key Features
- Installation
- Configuration and Usage
- Main Table
- Left Join 1
- Left Join 2
- Ordering and Quantity
- Dynamic Field Mapping
- Join Field Aliases
- Compatibility Fields
- Example - Articles with Categories and Authors
- Example - E-Commerce Products
- JP CS Global Pagination Integration
- Download Key and Updates
- Troubleshooting
- Best Practices
- Summary
- All Pages
JP CS DataQuery for YOOtheme Pro
JP CS DataQuery is an advanced Joomla system plugin that adds a flexible custom Dynamic Content source to YOOtheme Pro for querying and displaying records from Joomla database tables.
The plugin allows website builders to query Joomla core tables, third-party extension tables, and custom database tables directly inside YOOtheme Pro. It supports dynamic table and column discovery, sorting, limits, offsets, and up to two chained LEFT OUTER JOINs without requiring you to manually write SQL or PHP.
Key Features
- Query Joomla core, third-party extension, and custom database tables.
- Use database records directly as YOOtheme Pro Dynamic Content.
- Automatic database table and column discovery.
- Searchable table and column selectors inside the YOOtheme Pro Customizer.
- Supports up to two chained LEFT OUTER JOINs.
- Join the second table from either the Main Table or the first joined table.
- Dynamic field filtering based on the selected database tables.
- Automatic field aliases for joined database tables.
- Built-in compatibility fields and intelligent field fallbacks.
- Sort database results in ascending or descending order.
- Configure record Quantity / Limit and Start / Offset.
- Integration with JP CS Global Pagination.
- Joomla Update Sites and JPro Studio Download ID support.
- No manual SQL or PHP required for normal configuration.
Installation
- Log in to your Joomla Administrator dashboard.
- Go to System -> Install -> Extensions.
- Upload and install the JP CS DataQuery plugin ZIP package.
- After installation, go to System -> Manage -> Plugins.
- Search for System - JP CS DataQuery.
- Enable the plugin.
Configuration and Usage
JP CS DataQuery is configured directly from the Dynamic Content settings of a compatible YOOtheme Pro element.
- Open the required page or template in the YOOtheme Pro Builder.
- Add or select a compatible multi-item element, such as:
- Grid
- Panel Slider
- Table
- Another compatible YOOtheme Pro element
- Open the element's Advanced tab.
- Locate the Dynamic Content settings.
- Select Custom.
- Under the JPro Studio section, select JP CS DataQuery.
- Select the required Main Table.
- Configure sorting, quantity, and offset settings as required.
- Optionally configure one or two LEFT JOIN relationships.
- Return to the element's Content tab and map the required database fields.
- Save the YOOtheme Pro layout.
- Test the generated Dynamic Content on the frontend.
Main Table
The Main Table setting determines the primary Joomla database table queried by JP CS DataQuery.
The searchable selector automatically displays available database tables using clean table names. Joomla database prefixes are handled automatically, so you do not need to enter the #__ prefix manually.
Examples of possible Main Tables include:
content– Joomla articlescategories– Joomla categoriesusers– Joomla users- Third-party component tables
- E-commerce product tables
- Custom Joomla component tables
- Other custom database tables
After selecting the Main Table, JP CS DataQuery automatically discovers its available columns and makes them available for query configuration and Dynamic Content field mapping.
Left Join 1
Left Join 1 allows records from a second database table to be combined with records from the Main Table.
Enable Left Join 1
Enable this option when additional information required by your YOOtheme Pro layout is stored in another database table.
Join Table 1
Select the second database table that should be joined to the Main Table.
Main Table Column
Select the column from the Main Table that contains the relationship value.
Common examples include:
catidcreated_byproduct_id
Table 1 - Right Column
Select the matching column from Join Table 1. In many Joomla database relationships, this will be an id column.
Conceptually, the generated relationship works as follows:
LEFT JOIN #__join1_table AS t1
ON t0.join1_left = t1.join1_right
Left Join 2
JP CS DataQuery supports a second LEFT OUTER JOIN for more advanced database relationships.
The second join can connect either directly to the Main Table or to the table introduced by Left Join 1.
Enable Left Join 2
Enable this option when information from a third database table is required.
Join Table 2
Select the third database table that should be included in the query.
Join 2 Source Table
Select which existing table should provide the source column for the second relationship:
- Main Table (t0) – Join Table 2 is connected directly to the Main Table.
- Join Table 1 (t1) – Join Table 2 is chained from the first joined table.
Source Table Column
Select the column from the selected source table that should be used for the relationship.
Table 2 - Right Column
Select the matching column from Join Table 2.
When joining from the Main Table, the relationship works as follows:
LEFT JOIN #__join2_table AS t2
ON t0.join2_left = t2.join2_right
When chaining from Join Table 1, the relationship works as follows:
LEFT JOIN #__join2_table AS t2
ON t1.join2_left = t2.join2_right
Ordering and Quantity
Order By Column
Select a column from the Main Table to determine how returned records should be sorted.
Common examples include:
idcreatedorderingtitle
Order Direction
Select the required sorting direction:
- ASC – Ascending order
- DESC – Descending order
Quantity / Limit
The Quantity / Limit setting controls the maximum number of database records retrieved by the DataQuery source.
The default value is 10.
Start / Offset
The Start / Offset setting determines how many matching records should be skipped before returning results.
The default offset is 0.
For example, an offset of 10 skips the first ten matching records before returning the configured quantity.
Dynamic Field Mapping
After configuring the database query, return to the YOOtheme Pro element's Content tab and map the returned database values to the appropriate element fields.
JP CS DataQuery automatically exposes columns from the selected Main Table and enabled joined tables.
Main Table Fields
Columns are available using table-prefixed field names to help avoid conflicts between tables.
For example, when using the Joomla content table:
content_idcontent_titlecontent_introtextcontent_created
Direct Main Table column names are also preserved where applicable, such as:
titleintrotextcreated
Joined Table Fields
Joined table columns are also exposed using their table names.
For example:
categories_idcategories_titlecategories_aliasusers_idusers_nameusers_email
Join Field Aliases
JP CS DataQuery automatically creates convenient normalized aliases for fields returned by joined tables.
Join 1 Aliases
join1_idjoin1_titlejoin1_aliasjoin1_descriptionjoin1_value
Join 2 Aliases
join2_idjoin2_titlejoin2_aliasjoin2_descriptionjoin2_value
These normalized fields can make it easier to build reusable YOOtheme Pro layouts when database table names differ between projects.
Compatibility Fields and Automatic Fallbacks
JP CS DataQuery provides standard Dynamic Content fields with intelligent fallback mapping. This helps maintain compatibility with YOOtheme Pro layouts and presets that expect common field names.
Title
The title field attempts to resolve values from:
title
→ product_name
→ name
→ subject
→ heading
→ matching *_title or *_name fields
Short Description / Teaser
short_desc
→ product_s_desc
→ introtext
→ short_description
→ teaser
→ summary
→ description
Content / Description
description
→ short_desc
→ content
→ introtext
Product Link / Link
product_link
→ link
→ url
→ product_url
→ website
Product Image / Image
product_image
→ image
→ images
→ picture
→ file_url
→ thumbnail
→ photo
Price
price
→ product_price
→ cost
→ amount
Additional compatibility fields include document_link, link_demo, hits, and icons.
Example: Joomla Articles with Categories and Authors
A common use case is retrieving Joomla articles together with their category titles and author names.
Configuration
- Main Table:
content - Enable Left Join 1: Yes
- Join Table 1:
categories - Main Table Column:
catid - Table 1 - Right Column:
id - Enable Left Join 2: Yes
- Join Table 2:
users - Join 2 Source Table: Main Table
- Source Table Column:
created_by - Table 2 - Right Column:
id - Order By:
created - Order Direction: DESC
- Quantity: 10
Field Mapping
Example YOOtheme Pro field mappings:
- Title:
content_titleortitle - Meta / Category:
categories_title - Meta / Author:
users_name - Content:
content_introtext
The result provides article records together with their related category titles and author names, ready to display in a YOOtheme Pro layout.
Example: Custom Extension or E-Commerce Products
JP CS DataQuery can also retrieve records from third-party Joomla extensions and custom database tables.
For example, product information can be joined with a separate product description table.
Configuration
- Main Table:
eshop_products - Enable Left Join 1: Yes
- Join Table 1:
eshop_product_descriptions - Main Table Column:
id - Table 1 - Right Column:
product_id - Order By:
ordering - Order Direction: ASC
- Quantity: 20
The resulting records can contain product information together with localized title and description fields and can then be mapped directly to YOOtheme Pro elements.
JP CS Global Pagination Integration
JP CS DataQuery works with the JP CS Global Pagination plugin to paginate larger database result sets.
The Quantity / Limit setting in JP CS DataQuery determines the maximum pool of records available to the pagination system.
Basic Setup
- Configure JP CS DataQuery and confirm that the required records are displayed correctly.
- Set the DataQuery Quantity / Limit to the maximum number of records that should be available for pagination.
- Enable JP CS Global Pagination on the appropriate YOOtheme Pro element.
- Configure the required pagination page size.
- Save the layout and test pagination on the frontend.
JP CS Global Pagination can then slice the DataQuery result set into smaller pages and handle AJAX-based page transitions without requiring a complete page reload.
Download Key and Joomla Updates
JP CS DataQuery integrates with Joomla's native Update Sites system and supports a JPro Studio Download ID.
To configure the Download ID:
- Go to System -> Manage -> Plugins.
- Open System - JP CS DataQuery.
- Locate the Download Key setting.
- Enter your JPro Studio Download ID where required.
- Save the plugin configuration.
When configured, the plugin can validate the key with JPro Studio and display the associated subscription start and end dates.
Troubleshooting
JP CS DataQuery does not appear in Dynamic Content
- Confirm that System - JP CS DataQuery is installed and enabled.
- Confirm that you are configuring Dynamic Content inside YOOtheme Pro.
- Look under Custom -> JPro Studio -> JP CS DataQuery.
- Clear Joomla and YOOtheme Pro caches before testing again.
The required database table does not appear
- Confirm that the table exists in the Joomla database.
- Reload the YOOtheme Pro Customizer.
- Search using the clean table name without the Joomla database prefix.
Joined data is empty
- Confirm that the correct Join Table has been selected.
- Verify the Main Table Column and matching Right Column.
- Confirm that both columns contain matching relationship values.
- For Left Join 2, verify that the correct Join 2 Source Table is selected.
Expected fields do not appear in YOOtheme Pro
- Confirm that the correct Main Table is selected.
- Confirm that the required Join table is enabled.
- Reload the Dynamic Content configuration after changing tables.
- Look for table-prefixed fields such as
content_title,categories_title, orusers_name. - Check whether one of the standard compatibility fields can be used instead.
Only a limited number of records are displayed
- Check the Quantity / Limit setting.
- Increase the limit when more records should be available.
- Check the Start / Offset value.
- When using JP CS Global Pagination, ensure the DataQuery limit is large enough for the complete dataset you want to paginate.
Best Practices
- Start by configuring and testing the Main Table before adding joins.
- Add one database join at a time and verify the returned fields before adding another.
- Use the searchable table and column selectors instead of manually guessing database field names.
- Use table-prefixed fields when multiple tables contain columns with identical names.
- Use the built-in compatibility fields when creating reusable YOOtheme Pro layouts.
- Set a sensible Quantity / Limit instead of retrieving unnecessary database records.
- Use ordering to ensure records are returned consistently.
- Verify database relationships before configuring LEFT JOIN columns.
- Configure JP CS Global Pagination only after the DataQuery source itself is returning the correct records.
- Test complex queries on mobile, tablet, and desktop layouts.
- Always test extension updates on a staging website before deploying them to production.
Summary
JP CS DataQuery provides a flexible way to use Joomla database records as YOOtheme Pro Dynamic Content without manually writing SQL or PHP.
It can query Joomla core tables, third-party extension tables, and custom database tables while providing automatic schema discovery, searchable table and column selection, sorting, limits, offsets, dynamic field mapping, and up to two chained LEFT OUTER JOINs.
With intelligent compatibility fields and integration with JP CS Global Pagination, JP CS DataQuery can be used to build article listings, directories, product catalogs, custom component layouts, database-driven pages, and other advanced YOOtheme Pro websites using data already stored in Joomla.