DEPRECATION WARNING
This documentation is not using the current rendering mechanism and is probably outdated. The extension maintainer should switch to the new system. Details on how to use the rendering mechanism can be found here.
ForeignSingleTree¶
One more dropdown form element where the values originate in another table (like ForeignSingle). Only difference is that there is another table (a parent table to the foreign table) that helps visually (and only visually) by grouping the single foreign entries by a certain pattern.
sForeignDatabase¶
String. If set and different from the default database in this SQL Frontend, all calls relevant to this foreign key are executed on this foreign database. Keep in mind that the database has to be accessible by the same database user as defined in dbal.
sForeignTable¶
String. The table to fetch the entries from (within the same database).
sForeignColumn¶
String. Column/Field to save into the original/own table.
sForeignColumnShow¶
String. The column/field to show to the user.
sForeignTableOrderBy¶
String. The column/field to sort the foreign table by. Define the order in which to display the values to the user. Append an ASC (from a to z) or DESC (from z to a) to specify the direction.
Example:
name ASC
bForeignHideEmptyEntry¶
Boolean. If true, empty entries (we are talking about sForeignColumn) are not shown at all.
aForeignWhereShow¶
Array with where additions that is applied to the foreign table when loading values for output. Example:
'aForeignWhereShow' => array(
'pid:24',
'hidden:0'
)
Hint: You may use the well-known markers (see, for instance, dbal/MySql/sWhereGet) here. Example:
'aForeignWhereShow' => array(
'pid:###i:GP:id###',
'hidden:0',
'email:###s:fe_user:email###'
)
aForeignWhereForm¶
Array with where additions that is applied to the foreign table when loading values for the form. Example is actually the same as aForeignWhereShow except that you might want to add something or leave something out.
The difference between aForeignWhereShow and aForeignWhereForm is that the first is applied when loading values for outputs whereas the latter is applied when loading values for the form dropdown. This might come in handy whenever you want to give the user the possibility to select only entries that are x and y but want to display them even if they are now not y anymore. More practical example: Let users only select entries that are not hidden but since you change those settings from time to time you might still want to display entries where the foreign keys are -- in the meantime -- hiden.
aMapping¶
This is a very powerful array setting that allows you to translate real database-saved values to nicely formatted outputs (not for the form, though). Now this sounds as if you don't want to do that on your own but for limited amount of options it makes sense to configure that manually.
The only thing you need to do is to configure the value you want to translate (map, thus the name) as array key and the output it should become (be mapped on) as the configuration value. Pretty easy example: Translate the cars into their logos:
'aMapping' => array(
'10' => '<img src="fileadmin/img/volvo.png" alt="Volvo" />',
'11' => '<img src="fileadmin/img/saab.png" alt="Saab" />',
'20' => '<img src="fileadmin/img/mercedes.png" alt="Mercedes" />',
'21' => '<img src="fileadmin/img/audi.png" alt="Audi" />'
)
sForeignColumnParentKey¶
String. Field/Column within the foreign table that holds a key indicating which parent entry to use. Imagine you want to have tt_content records as foreign keys and, for simplicity, group them by the page they are on. In this case your foreign table is tt_content and this setting is
pid
sForeignParentDatabase¶
String. The database (if different from the currently set dbal/sDatabase) to look for the parent table.
sForeignParentColumn¶
String. Column/Field that is connected with sForeignColumnParentKey (the other end of this key relation). In the example from sForeignColumnParentKey this would be
uid
sForeignParentColumnShow¶
String. This is the column/field from the parent table to show. Example:
title
sForeignParentOrderBy¶
String. You don't have to but if you like you might order the parent entries.
By the way: Ordering of the foreign table (sForeignTableOrderBy) is applied within this ordering. So if you order pages by their title and content elements by their header, the resulting dropdown has pages ordered by their title and within each page the content elements are sorted by their header.
aForeignWhereParent¶
Array. There is only here as they are empty if no foreign entries are found. Thus you might configure show-/form-specific settings within aForeignWhereShow and aForeignWhereForm.
sConcatenate¶
String. When showing the entry by default the parent row is concatenated with the foreign entry. What you may specify here is how they get connected. Example and default:
:
The example is translated to
page title: content element header
sConcatenateRaw¶
String. Like sConcatenate but only used when in raw mode (e.g. for CSV output). Default is the same as for sConcatenate.
sWrapChildren¶
String. You may use markers here as well as all columns from within the children (original) table. Example:
| (###uid###)
sWrapParent¶
String. Same as with sWrapChildren but for entries within the parent table.