xtaggen
Universal Content Tag Generator
Pull content from any module in your XOOPS site with a single Smarty tag into any theme template. Zero PHP knowledge, maximum flexibility.
Single tag,
endless content.
xtaggen is a Smarty3 function plugin written to pull database content from any installed module
in XOOPS CMS directly into theme template files (.tpl).
information_schema. Extracts main content table, column map, and URL structure on its own.
module="directory_name". xtaggen handles the rest.
$item.title), any non-matching column is also available in the template as $item.COLUMN_NAME and $item.raw_COLUMN.
debug parameter outputs the selected table, column list, alias map, and executed SQL query as HTML comments on the page.
Data flow in
4 steps.
When the tag runs during Smarty template rendering, the following process happens in the background:
module parameter is read. Checks if the module directory exists in XOOPS. Compares against the list of dedicated handlers.
information_schema, selects the main table, extracts columns, and creates an alias map.
sort mode (RAND(), alias column, title column, etc.) and fetches data.
Handler System
Paste into theme template,
it just works.
Write the tag anywhere in your .tpl file. The template file is searched for in the theme directory or module directory.
/themes/YOUR_THEME/templates/TEMPLATE.tpl →
/modules/MODULE/templates/TEMPLATE.tpl →
/modules/xtaggen/templates/TEMPLATE.tpl →
/themes/YOUR_THEME/templates/xtaggen_default.tpl
A parameter
for every need.
All parameters you can use inside the tag. Only module is required.
| Parameter | Default | Description |
|---|---|---|
| modulerequired | — | XOOPS module directory name. Must exactly match the folder name under /modules/. Example: "tdmdownloads", "news", "wfsection" |
| limitoptional | 10 | Number of records to fetch. Minimum 1. |
| fromoptional | 0 | Starting record offset. Used as SQL OFFSET. Useful for manual pagination. |
| orderoptional | auto | ORDER BY column. If left blank, automatically selects date → ID → first column. Ignored when sort="RAND", "POPULAR", or "ALPHA" is used. |
| sortoptional | DESC | Sorting mode. Valid values: DESC · ASC · RAND · POPULAR · ALPHA · ALPHA_DESC |
| templateoptional | MODULE_list | Name of the Smarty template file to use (without extension). Example: "news" → searches for news.tpl |
| categoryoptional | — | Filter by category ID. Works with publisher, xcreate, and generic modules that have a category_id column. |
| statusoptional | 1 | Status filter. Valid for publisher and xcreate. 0 for drafts, 1 for published content. |
| topic_idoptional | — | Only for the news module. Filters news articles belonging to a specific topic. |
| cat_slugoptional | — | Only for the xcreate module. Filter by category slug instead of ID. |
| debugoptional | — | Takes no value, just including it is enough. Outputs table name, column list, alias map, and SQL query as HTML comments. Do not use on live sites. |
6 different
sorting modes.
Use the sort parameter to fetch content in any order you want.
The order parameter is ignored in POPULAR and ALPHA modes.
order column. Typically for latest content.order column. Chronological order or smallest to largest ID.ORDER BY RAND(). Ideal for featured content widgets.counter, hits, views, or downloads column in the table and sorts in descending order.Three ways
to access data.
The generic handler creates a three-layer array for each record. Aliases always take precedence.
$item.COLUMN_NAME (sanitized).
For example, xaf9_tdmdownloads_filesize column →
accessible via {$item.xaf9_tdmdownloads_filesize}.
$item.raw_COLUMN_NAME. Whether aliased or not:
{$item.raw_published_date}, {$item.raw_downloads}, etc.
Everything
on one screen.
Clicking on the xtaggen module in the XOOPS administration panel opens a 5-page full control center.
- Statistics on number of installed modules
- Dedicated / generic handler distribution
- Active / unconfigured modules
- Quick start steps
- Limit, sorting, template settings for each module
- Active / passive toggle
- Saved configurations written to database
- Category and status filters
- Ready-to-copy Smarty tag code for each module
- All template variables — aliased, direct, and raw_
- Column map tab
- Auto-generated sample template code
- Copies the
function.xtaggen.phpfile to the correct location - Smarty3 plugin directory auto-detected
- Installation status check
- All parameters and sort modes
- Module-specific copyable examples
- Template variables reference
- Copy button on every code block
Ready in
5 minutes.
XOOPS module installation and plugin activation are two separate steps. Both must be completed.
xtaggen/ folder to the /modules/ directory of your XOOPS installation.
function.xtaggen.php file to the Smarty3 plugin directory.
/class/smarty3_plugins/function.xtaggen.php.
.tpl file in your theme directory. You can paste the automatically generated sample template code from the Tag Generator page.
index.tpl, header.tpl, etc.). That's all.
function.xtaggen.php file in the /class/smarty3_plugins/ directory.
The Plugin Install page in the admin panel does this automatically.