-
-
Notifications
You must be signed in to change notification settings - Fork 12
11. Advanced examples
In case you want to have a functional catalog embedded to a Layout or an article - iframe tag. You can provide some URL query parameter to filter catalog records.
Below is an example of a Catalog in side Edit Record Layout:

Where "/index.php/subjects-list" is the link to a menu item that has Custom Tables - Catalog type
"type=3" is a query parameter that we want to mass to a catalog to filter
"3" ID of the current record, if the page where you want to have a functional catalog is Edit Record or Record Details type.
"tmpl=component" is to not render front-end template.

This is Custom Tables - Catalog type menu item.
I passed parameter type with the URL query. Now we will use it to filter catalog records.
I have a field "type" in my table. I want to show all the records that have the type id equal to type URL parameter.
"$get_" is a short tag to get URL parameter value. This works in filters only. Menu Items, Custom Tables Catalog and Custom Tables Record plugins.

Add menu type: "Custom Tables - Catalog"
Click on Filter tab
and the parameter "Search Parameter", set it to "USER={currentuserid}", where "user" is the name field in your custom table where user ID is stored.
{currentuserid} will be replaced by the current user id automatically.
This is equal to MySQL query example:
SELECT * FROM #__customtables_table_myfirsttable WHERE es_user=200042
"myfirsttable" is the name of the table, for example.