Joomla SQL query plugin, module, extension, component. Renders SQL query in Joomla article.
Renders table by data from SQL query. Allows to write SQL query in plugin parameters and create table with customizable columns containing data from database. This plugin is also a part of ARI Smart Content: DataTable Pack
Features:
- Needs SQL knowledge to create query
- Supports SQL queries of any complexity
- Customizable columns
- Could be wrapped by other table plugins, for example AriJFlexGrid or AriJTableSorter to adjust table look and functionality.
Example:
| ID | Title |
|---|
| 1 | Main Menu | | 2 | Login | | 3 | Popular | | 4 | Recent added Articles | | 5 | Menu Stats | | 6 | Unread Messages | | 7 | Online Users | | 8 | Toolbar | | 9 | Quick Icons | | 10 | Logged in Users | | 11 | Footer | | 12 | Admin Menu | | 13 | Admin SubMenu | | 14 | User Status | | 15 | Title | | 19 | ARI Smart content | | 18 | ARI Process Content | | 20 | Top Menu | | 21 | JoomlaStats Activation Module | | 24 | Plugins repositoty |
This will create table containing user information.
Arisqltablequery should contain SQL query. Arisqltablecolumns is not mandatory tag and is used for columns customization. Arisqltablecolumns tag contains arisqltablecolumn tags.
| ID | Title |
|---|
| 1 | Main Menu | | 2 | Login | | 3 | Popular | | 4 | Recent added Articles | | 5 | Menu Stats | | 6 | Unread Messages | | 7 | Online Users | | 8 | Toolbar | | 9 | Quick Icons | | 10 | Logged in Users | | 11 | Footer | | 12 | Admin Menu | | 13 | Admin SubMenu | | 14 | User Status | | 15 | Title | | 19 | ARI Smart content | | 18 | ARI Process Content | | 20 | Top Menu | | 21 | JoomlaStats Activation Module | | 24 | Plugins repositoty |
ARISQLTable wrapped with AriJTableSorter.
Usage:
{arisqltable}
{arisqltablecolumns}
{arisqltablecolumn id="ID" alias="ID" width="20%" className="idg"}
{arisqltablecolumn id="NAME" alias="UserName" headerClassName="head"}
{arisqltablecolumn alias="Virtual Column" headerClassName="head" virtual="true" pos="1"}
{coltemplate}{$NAME} - {$ID}{/coltemplate}
{/arisqltablecolumn}
{/arisqltablecolumns}
{arisqltablequery}
SELECT id AS ID,name AS NAME
FROM #__users
{/arisqltablequery}
{/arisqltable}
or
{arisqltable}
{ariconnectionstring dbHost="localhost" dbUser="user" dbPass="pass" dbName="joomla" dbType="mysqli"}
{arisqltablecolumns}
{arisqltablecolumn id="ID" alias="ID" width="20%" className="idg"}
{arisqltablecolumn id="NAME" alias="UserName" headerClassName="head"}
{/arisqltablecolumns}
{arisqltablequery}
SELECT id AS ID,name AS NAME
FROM jos_users
{/arisqltablequery}
{/arisqltable}
Parameters:
- arisqltable parameters:
- header - Display header or not. Values: true, false
- footer – display footer or not. Values: true, false
- cellPadding – cell padding. Values: number
- cellSpacing – cell spacing. Values: number
- width – table width. Values: px or percentage
- className – CSS class name to be applied to the table
- inputEncoding - Indicate input encoding. Values: input encoding
- advancedStyling - If this parameter is enabled, HTML table will contain additional CSS classes for each column and row. Values: true, false
- arisqltablequery parameters:
- saveTags - Save HTML tags
- arisqltablecolumn parameters:
- id – column name in SQL table
- className – CSS class name to be applied to content cells (td)
- headerClassName – CSS class name to be applied to header (th)
- width – width. Values: px, percentage
- alias – columns name to be displayed on UI. Values: string
- headCellTag - HTML tag. Values: th,td
- cellTag - HTML tag. Values: th,td
- virtual - Indicate that this column is virtual. Values: true, false
- hidden - Indicate that this column will be hidden. Values: true, false
- pos - Column order. Values: integer
- arisqltablecolumnspan parameters:
- row - Row index(es). Values: zero-based row index (for header and footer use -1)
- startIndex - Start column index. Values: zero-based column index
- endIndex - End column index. Values: zero-based column index
- ariconnectionstring parameters:
- dbHost - database host (default localhost)
- dbName - database name
- dbUser - database user (default root)
- dbPass - database pass
- dbType - database provider. The following values are allowed: fbsql, gladius, maxdb, msql, mssql, mssqlpro, mysql, mysqli, mysqlt, odbc, postgres, postgres64, postgres7, postgres8, sqlite, sqlitepro, sybase, sybase_ace. (Attention: plugin will work correctly only if php extensions for selected provider are installed)
|