Login / Status
developer.Resource
Home . Documentation . Document Library . Extension Manuals
Sponsors
hosted by punkt.deTYPO3 and Open Source Magazine

1.3. Configuration

Let's have a look at our configuration options divided into the tabs from the flexform ...

GENERAL

Charset

This is the first option in two ways: It's the first in the flexform and it's the first on the list of potential errors.

It's the character set that is used for reformatting stuff from the database, for data exchange in AJAX calls and it's the encoding default before writing values into the database. Choose it carefully and in case the frontend doesn't work as expected (probably you get XML response errors – this is because the AJAX response isn't valid XML code mostly because of some special characters that haven't correctly been encoded → charset missetting) start playing around with this option.

Of course if your database and website are real UTF-8 always use UTF-8!

Enable 'add'

Enable it and the frontend user is able to add new entries to the table. Of course, if you hide some fields from the table, the user is only able to enter the shown fields.

Enabled 'edit', 'delete'

The same as for 'add'.

By the way: If your edit/add mode is 'in row' (see OPTICAL) you might edit an entry by just clicking it somewhere (the cursor turns into a pointer except on 'Links'-columns).

Enable 'duplicate' (only if 'add')

In case adding is enabled you can offer the user to duplicate entries. In this case per row a symbol is shown for duplicating and – if clicked – an 'insert new row' form is displayed that already has the values from the duplicated entry filled in (it's not saved at that point).

Important to know here: The original record won't get changed!

Important to know here – part two: If you don't show all the fields, the hidden ones get directly copy/pasted from the duplicated entry. So if you don't show e.g. a 'name' column but the 'description' column is displayed and the frontend user duplicates an entry with name = 'foo' and description = 'bar' a form for adding a new entry is shown with 'bar' already filled in. We change this to 'beer bar' and save then the new entry will have name = 'foo' and description = 'beer bar'!

Enable multiple changes ('edit'/'delete')

If enabled checkboxes are shown for each line on the left-hand side and a drop-down offering the options to multiple edit or multiple delete all marked entries. If you check the box in the top left corner, all currently shown entries are marked (not the ones on other pages).

Show search form

Well, as the name says ... show or don't – the search form. Note: By default only all displayed fields are searched.

Enable AutoFilter for these columns (coma list)

Create AutoFilter drop-downs for various fields. Just enter the names and separate with a coma. Example: name, description

Display 'Show All' (only if not all entries on one page)

In case you have paging enabled (see DATABASE) you might want to offer the user the possibility to see all entries on one page. Enable this option and a small icon will do so in the fronend (top left corner by default).

Enable user-dependent column hiding (only if an user is logged in)

In case a user is logged in and you have this option activated, little icons in each column's first line are shown where a click hides the complete column. This setting is dependent on the user meaning that if a user hides a column, it is only hidden for this user, not for all users. Furthermore this setting causes the 'Edit/Add/Duplicate mode' on the 'OPTICAL' tab to be separated (just for your information, the extension takes care of this issue).

Hidden columns can be shown again by choosing the hidden column in the drop-down box beyond the table and clicking the little 'show column again' icon next to it. Note that this drop-down is only shown if columns are hidden for this user.

CSV Download

If enabled, the user is able to download the list as a CSV file. 'all at once' means that the user is able to download a file containing all the records he/she sees (of course only shown fields). 'only selected parts' downloads only entries that are currently marked (as in 'multiple changes') with the checkbox. This might be useful together with an AutoFilter (use AutoFilter, check all shown entries and download these as CSV).

Enable keyboard shortcuts (Beta!)

Well, as it says, this is in Beta stadium, please do not rely on this feature. It's tested and works in FF 3.5.x, IE 6, IE 7, IE 8, Chrome 3.0.x and Opera 10.1. In case you have this feature enabled, what shortcuts are available?

Shortcut

Abbreviation stands for

Used for function

Notes

Shift + N

New

Add new entry to the list

Doesn't work if cursor is located inside an input element (otherwise it would be impossible to write a capital N)

Shift + F

Find

Put focus into search field

Doesn't work if cursor is located inside an input element …

Shift + D

Delete filters

Resets autofilters, search queries, pagination (just like a click on the “delete filter” icon next to the search box)

Doesn't work if cursor is …

Shift + A

All

Shows all entries on the same page (like the click on the list symbol next to the “delete filter” icon does)

Doesn't work if cursor is ...

Send emails – 'To' address

You can get informed about changes in your database done via the SQL frontend. Enter the eMail address here ...

Send emails on ...

... and select when you want to be informed.

DATABASE

Use TYPO3 database (default)

First of all the extension needs to know the database connection. If you want to use a table from the TYPO3 default database you don't have to define the username/password settings here again. Just check this option and ignore the next options until 'Table name'.

AdoDb database type, Host or DSN, Database name, Username, Password

In case you didn't check the option above you have to enter stuff here. What database types you can select depends on your webserver and on the PHP installation (please see http://at2.php.net/manual/en/mssql.setup.php and http://at2.php.net/manual/en/intro.uodbc.php for more information).

Table name

Enter the table name here that you want to show.

Show those database fields and links (coma list)

This is a very important setting. Specify here what you want to see in the frontend. Just enter the column names and separate with a coma. An example on the fe_users table: uid, username, name, telephone, email

Also this is the setting that is sometimes referred to as 'the shown/displayed fields ...

The order of how the fields are entered is important here and represents the order shown in the frontend. So 'uid, username, name' is not the same as 'uid, name, username'! If you have links defined (see ADVANCED) use the name you entered there to define the position here.

Search all fields (instead only shown ones)

As mentioned before at the 'Show search form' option only shown fields are searched by default. Check this option to search all fields. Of course only the specified ones are shown.

Database column that's the sorting default (incl. asc/desc)

You want to order per default by the username column descending. Enter 'username desc' (without the apostrophes) here. The opposite would be 'username asc'. This field is SQL style, so if you want advanced configuration here look at e.g. mysql.org for details (order by section).

Amount of entries per page (all if empty)

The famous 'paging'. Enter how many entries are shown on one page. If you leave this field, all is shown. Also the setting form GENERAL, 'Display Show All' is ignored in this case.

Additional WHERE part (SQL-style excl. 'WHERE')

If you need more advanced features you can enter a SQL statement part here that will be included using 'AND' inside the 'WHERE' part. Don't use a leading or ending 'AND', 'OR' or 'WHERE' here. Example: ' username NOT LIKE 'admin%' AND uid < 1000' (it's an example, don't ask for the sense of this part ;o))

There are markers that get replaced here which you might use:

Marker

Gets replaced with ...

###ID###

… the current page ID

###UID###

… the user id from the currently logged in user

###USERNAME###

… the username from the currently logged in user

###NAME###

… the name from the currently logged in user

###EMAIL###

… email address from the currently logged in user

Only current user via ID (uid column)

In case you need to regulate the shown entries based on the logged in frontend user you probably want to use this field. Enter the column name of the field that contains the frontend user id here and the extension does the rest for you.

Example: Your table stores books from certain people. The fields are 'id, bookname, isbn, detaillink, user' and the 'user' field contains the owner's frontend user id. So all you need to do is entering 'user' here.

What does the extension then do for you?

  1. only display rows with the user id from the currently logged in user (if none, the table seems empty to the user)

  2. when adding a new entry the current user id is automatically written into this field

  3. in case the user is able to edit the user id field it is overwritten with the logged in one (no matter what the user enters here manually)

Only current user via username (username column)

Same as option before but based on the username instead of the id.

Use special statement

In case all the options are not enough for you then this is your preferred choice. Enter a complete SQL statement here and the extension uses this return to display in the frontend. Sounds cool but where is the catch? Well, in this case not all of the other options are possible anymore. What is and what isn't shows the following table ...

Special Statement

What does work using a Special Statement and what does not:

Name

Works / Doesn't Work

Why not?

Charset

Enable 'add'

The extension doesn't know which fields to use for adding. Though if you're special-statementing over various tables – insert into which one?

Furthermore you don't insert a database table (And that's good!) so the extension cannot read the table structure (again – if you're querying over multiple table: which table structure ;-))

Enable 'edit'

See 'Enable add'

Enable 'delete'

See 'Enable edit'

Enable 'duplicate'

See 'Enable 'delete'

Enable multiple changes (edit/delete)

See 'Enable edit' or 'Enable delete'

Show search form

Too much effort for too less earning.

Enable AutoFilter

Remember that you have to insert the final SQL header here. So if you 'SELECT foo AS bar FROM table' you need to insert 'bar' and not 'foo' here (The extension cannot read the table, remember?!)!

Display 'Show All'

Enable user-dependent column hiding

Not implemented yet.

CSV Download

Not the line-dependent but the all-at-once download.

Enable keyboard shortcuts (Beta!)

Even though not all the shortcuts make sense in this mode.

Send eMails

Since none of the eMail circumstances works eMailing doesn't make sense.

DATABASE SETTINGS

Which one make sense? Only those work:

 - Use TYPO3 database, adodb Database type, Host, Database name, Username and Password (we need these for the database connection)

 - Special Statement ('Haha!')

 - Amount of entries per page (see next point)

----> Amount of entries per page

Do not use a 'LIMIT' section in your statement just for paging purposes (the extension handles this itself). Though you may include a 'LIMIT' section for any other reason!

Show primary key image

Which one is the primary key? How should the extension know?

Different column titles

Not needed, use SQL Aliases ('... AS ...') instead!

Edit/Add/Duplicate mode

See 'Enable add', 'Enable 'edit' and 'Enable duplicate'

CSS class for every second line

CSS class for table

Column width's

Don't include stylesheet

Use manual layout (for professionals ...)

Template (other than default)

Choose already uploaded template

Conditional formatting

Debug mode

Enable caching

Not at the moment, probably in a future version.

Do not use htmlentities()

Don't convert tinyint(1, 2, 3) fields to bool

See 'Enable add' or 'Enable edit'

Format timestamps as date

Not needed, use some of the SQL datetime functions instead.

Show date selector

See 'Enable add' or 'Enable edit'

Date/Time format

Enable RTE

See 'Show date selector'

Only allow those fields to be edited

See 'Enable add' or 'Enable edit'

Change field on delete

See 'Enable delete'

Set changedate on save/add

See 'Enable add' or 'Enable edit'

Show sum at the bottom of the table

Only total sums work, not subtotal ones (see 'Enable delete').

Foreign keys

See 'Enable add'

Additional links

Not needed, use the SQL 'CONCAT' function instead.

Callback functions

Pre-defined values per column

See 'Enable edit'

JavaScript to be executed …

Well, only those that make sense (not adding, deleting, …)

FILE HANDLING

Only the the output element (special templates for various file extensions) makes sense and thus is possible. All the others regard editing options.

OPTICAL

Show primary key image

Display a small key next to the primary key headline to indicate that his is the PK.BUG: Currently this doesn't work with MsSQL databases, I know that.

Different column titles than in database (coma list)

Enter the real headlines for the columns here – in the same order as the 'DATABASE > Show those database fields' setting. In case something should be empty, include an empty string in the coma list (e.g.: 'foo, bar, , last'). If you want to use a coma, prefix it with a backslash ('foo, bar\, beer, , last').

Edit/Add/Duplicate mode

This setting was also mentioned before. You can choose between ...

  1. in row: instead of the value input boxes for editing are shown inside the line

  2. separated (columns among each other): replaces the complete table when in editing mode

Best here is to test both modes in order to understand what they are used for (remember: it's just optical, no functional differences). Note that with column hiding enabled this mode may change to 'separated' for users that have certain columns hidden.

CSS class for every second line ('alternate' is fine)

For a better overview every second line can be colored in a different way. By default a SQL frontend stylesheet is included where an 'alternate' class is defined – so it's fine here leaving this class. If you want to fit the layout to your design wishes enter the class name here.

CSS class for table

What is entered here gets included in the class-attribute inside the table-tag.

Column width's (coma list; use %|px|em after each value)

Using this option you can define width for the output table. Per default no width attribute (well, it's a style attribute with a width option) is used. To define it, use something like the following:

  1. 30%, 50%, 5%, 5%, 10%

  2. 40px, 100px, 150px

  3. 0.2em, 1.4em, 12em

In case you have deleting and/or multiple edits enabled, these additional columns (the first one with the checkboxes and the last one with the delete/duplicate buttons) won't have any width defined. So if you define percentages, keep in mind that it won't be 100% the same thing as defined as HTML needs a bit space for those additional columns.

Don't include stylesheet

Do not include the default SQL frontend stylesheet (which is by the way located in the extension directory – typically typo3conf/ext/mh_omsqlio/ - and then inside the res/ folder (name: tx_mhomsqlio_style.css).

Use manual layout (for professionals; see docs)

Well, here we are: At the docs! Normally every entry is represented by one single row in the table. You don't want that? Or you don't want a table layout? Check this option and change the template. The principle is almost the same as in serial letters: The template is used with the first record until the ###NEXT### marker appears. Then the template goes on using the next record. Until the next ###NEXT### marker is used. The record changes again to the next one. And so on until the template is finished. Then it starts again at the beginning ...

Lets have a look at the default template used here – MANUAL_LIST:

<!-- ###MANUAL_LIST### begin →<table id="###TABLE-ID###" class="###TABLE-CLASS###" cellpadding="0" cellspacing="0"><tbody><!-- ###LIST_INNER### begin →<tr><td><img src=”uploads/pics/###image###” alt=”###name###” /></td>###NEXT###<td><img src=”uploads/pics/###image###” alt=”###name###” /></td>###NEXT###<td><img src=”uploads/pics/###image###” alt=”###name###” /></td>###NEXT###<td><img src=”uploads/pics/###image###” alt=”###name###” /></td>###NEXT###<td><img src=”uploads/pics/###image###” alt=”###name###” /></td></tr>###NEXT###<!-- ###LIST_INNER### end →<!-- ###LIST_INNER_FILL### begin →<td>&nbsp;</td><!-- ###LIST_INNER_FILL### end →</tbody></table><!-- ###MANUAL_LIST### end →

The complete template is divided into the outer and the ###LIST_INNER### part. The LIST_INNER part is the one used with the records. It starts with the first one until the first 'More' link – afterwards a ###NEXT### appears so the record changes to the next entry. And so on until the end of the template where we find the fifth ###NEXT### marker. So now we go on at the beginning of the LIST_INNER template with the sixth record.

Result: We have five entries per line (in this example five images) and the fifth closes the row. The sixth entry (by the way it is used with the fe_users table) starts a new line.

So what happens in the last row? Imagine we have eleven entries → two rows and one left??? It creates the first one and then? Well the extension counts how many entries you have per LIST_INNER template and fills the last one up with the stuff inside the LIST_INNER_FILL markers. So the result using eleven lines will be:

<table id="###TABLE-ID###" class="###TABLE-CLASS###" cellpadding="0" cellspacing="0"><tbody><tr><td><img src=”uploads/pics/###image###” alt=”###name###” /></td><td><img src=”uploads/pics/###image###” alt=”###name###” /></td><td><img src=”uploads/pics/###image###” alt=”###name###” /></td><td><img src=”uploads/pics/###image###” alt=”###name###” /></td><td><img src=”uploads/pics/###image###” alt=”###name###” /></td></tr><tr><td><img src=”uploads/pics/###image###” alt=”###name###” /></td><td><img src=”uploads/pics/###image###” alt=”###name###” /></td><td><img src=”uploads/pics/###image###” alt=”###name###” /></td><td><img src=”uploads/pics/###image###” alt=”###name###” /></td><td><img src=”uploads/pics/###image###” alt=”###name###” /></td></tr><tr><td><img src=”uploads/pics/###image###” alt=”###name###” /></td><td><td>&nbsp;</td></td><td><td>&nbsp;</td></td><td><td>&nbsp;</td></td><td><td>&nbsp;</td></td></tr></tbody></table>

Template (other than default)

If you want to use your own template you might either fit the default one to your needs (not the best idea since it's overwritten at the next update) which can be found inside the extension directory and then res/tx_mhomqslio_pi1.html.

The other option is this one here – upload your own template.

Choose already uploaded template

If you include the plugin on more than one places in your system and have a personal (other than default) template you might want to use all the time, upload it in one plugin and use it here in all the others.

Conditional formatting (see documentation first)

Per default every second line is colored slightly different in order to optimize overview (this behavior is editable via the 'CSS class for every second line' setting). Nevertheless sometimes it might be useful to color rows depending on their content. For example to mark urgent lines, visualize priorities or display which entries are marked with today's date. Therefore the conditional formatting can be used which is due to ultimate flexibility a bit tricky at the first point, so here are three basics to keep in mind:

  1. you need to define rules – as many as you like

  2. rules are read from top to bottom, if one fits, the rest is going to be ignored

  3. rules are separated with a line break, one rule per line

A rule normally consists of two parts, the condition and the format depending on this condition, separated with a ':'. The first part has to be standard PHP code as used inside the brackets of an 'if' condition. All (not only the shown ones) columns of the database table filled with values from the current row are accessible and usable via a dollar sign and the column name (e.g. $id, $username, $another_important_column, …). In case this condition turns out to be valid and thus returns true the second part is used as color. In order to work properly this part might be some hex color code (e.g. #F00, #E1CCF3, …), a web-standard color name (e.g. orange, red, black, white) or a column name wrapped within three # signs (e.g. ###id###, ###username###, ###another_important_column###, …) that contains the color code.

Examples should make things clearer:

  1. $username != 'admin' : #FFFIf the username column is not equal 'admin' (without the single quotes) the background color is white.

  2. $year > 2000 && $year <= date('Y') : greenThe year column has to be larger than 2000 and (&&) smaller or equal to the current year that comes from the PHP function date('Y') (see www.php.net/date) in order to color the row green.

  3. trim($dad) == '' || trim($mum) == '' : ###color_sad###In case one of the trimmed (www.php.net/trim) strings in the columns dad or mum (|| is the opposite of && and means 'or') is empty the color in the column 'color_sad' is used.

All examples above are just single rules. In real TYPO3 administrator's life you probably need to define more than just one rule. In this case separate them with new lines and keep in mind that the mh_omsqlio rule processor runs from top to bottom and stops immediately after a condition returns true:

$some_percent > 90 : red$some_percent > 70 : orange$some_percent > 50 : yellow

The column 'some_percent' is used. In case it's larger than 90 the line turns red, larger than 70 means orange and larger than 50 says yellow.

Let's reverse the order and see what happens:

$some_percent > 50 : yellow$some_percent > 70 : orange$some_percent > 90 : red

The first value, let's say 98, gets checked. In the example above it would be larger than 90 and thus turn red, which is what we want. In our second example it would again run from top to bottom but stop at the first point since 98 is larger than 50 and so it turns yellow. Ouch.

What about the rest? What color will a value of 35 have? White! Unless you define an absolute 'else' part which is another line just with the second argument:

$some_percent > 90 : red$some_percent > 70 : orange$some_percent > 50 : yellowgreen

Now the rest that doesn't fit to the first three rules turns green. What's going to happen if 'green' is written on top? Correct, everything is green. Remember, top to bottom. First to check is the else argument? Well, let's take it!

ADVANCED

Debug mode (for administrators only!)

Get a database error in the frontend? Check this option to view the produced SQL statement and various configuration material that might give you a hint (in case you know SQL) which configuration is wrong. Don't forget to disable it again afterwards.

Enable caching

For very large tables this setting might improve performance a bit. Especially if you have lots of callback functions and special links defined, this option might help you a little.

Do not use htmlentities()

Output is per default htmlentities'ed – check this to disable it. This is another very important setting if your frontend doesn't do what it's expected to (see charset option).

Don't convert 'tinyint(1,2,3)' fields to 'bool'

When adding or editing entries the extension tries to find the best solution of input box for you. Typically bool values are simulated in databases using tinyint fields with sizes from 1 to 3. So the extension provides a checkbox instead of an input field in such cases. You can disable this behavior by checking this option.

Format timestamp(s) as date(s) (column names; coma list)

You have UNIX timestamps in your database? Bring them to a human-readable format by entering the column names here. Example (from pages table): SYS_LASTCHANGED, crdate

Show date selector(s) (column names; coma list)

When editing datetime fields you might want to offer the user a calendar. Enter the column names here and have the date2cal or the erotea_date2cal extension installed.

Note that this doesn't work with unformatted UNIX timestamps. You need to convert them first by using the previous setting (Format timestamps as dates).

Date/Time format (for timestamps)

Choose the format you want to present the formatted timestamps in. Also this is the format used for the calendar plugin(s).

Enable RTE(s) (column names; coma list)

This isn't implemented yet. I tried to do so (this is why this option is still here) but didn't make it in time).

UPDATE: I tried it one more time but without a popup window it's currently not possible. Still on the ToDo list.

Only allow those fields to be edited (column names; coma list)

In case editing is enabled the user is by default allowed to edit all the fields that are shown in the table. You may want to restrict this so here is your tool. Enter those column names (not your individual titles) and separate them with a coma that you want to be editable. As an example imagine a table that consists out of the columns id, name, children and age. You only display the columns name, children and age but want the user only to be able to edit children and age. Enter 'children, age' here and the user sees name, children and age but when editing only children and age can be accessed.

Change field on delete (column; undeleted; deleted)

In case your table provides a deleted flag and you don't want to delete records completely on a delete click this option is for you. Best example is the fe_users table. If you delete a frontend user in TYPO3 it's not completely deleted but set as deleted in the database. Same here. Example configuration for TYPO3 deletion flags: deleted; 0; 1

This tells the extension that the field deleted is the flag; if it's set to 0 a record is not deleted, if set to 1 it's deleted! What does the SQL frontend now do?

  1. only display not-deleted entries (so add a 'deleted = 0' part to the SQL WHERE)

  2. if a record is created and this field is not shown it's per default set to the not-deleted status (in this case 0)

  3. on delete click the record is not deleted but set to the deleted status (here: 1)

Set add/changedate timestamp on save/add (column name)

Sometimes you want to log the last changes in a table by adding an UNIX timestamp on each change. This field can do so for you. If you want to edit the TYPO3 pages table you would have to insert hert: SYS_LASTCHANGED

This column holds the UNIX timestamp when the last change has been done. SQL Frontend always sets this field on editing (well only on saving, not on aborting) and when adding a new entry; not on deletion!

Since version 2.4.0 this feature is splitted:

It's now possible to have both, a creation and a last edited date. The changedate timestamp on add will be written every time a new entry is created. The changedate timestamp on save will be set when editing one (not on deletion).

Show sum at the bottom of the table (column names; coma list)

In case you have numbers that should be summed up, use this function. Just enter the column name(s), for which you want sums to be shown. Those values will be processes using the same options as the rest of this column. This means that if you have e.g. an outwards callback function defined for the column 'price' that prefixes the value with a currency symbol, also the sum is processed using this callback function.

If enabled the table gets a footer appended, which includes two values per defined column, the upper one indicates the sum of all currently shown entries (e.g. all on page one or all currently filtered ones), the number beyond this subtotal is the complete total (the one with the sum icon) of all numbers in that table. Still this number does not include entries that are excluded via a WHERE statement part.

Foreign keys (own col, table, foreign col [, show col, order, where];)

You have foreign keys in your table? Here is what you are looking for. Configure SQL Frontend to show not the ID located in this table but the referenced value from the other table. And in editing/adding mode not an input field but a drop-down is presented containing all the possible values from the other table. What???

It's simple: A tt_content entry always has a PID which represents the page this content element is located on. This is a foreign key since it is just the page id referencing to the pages table that has a uid field holding this exact ID. Normally you don't want to display this PID but the pagetitle instead. Configure SQL Frontend to do so – in our table we want PID (own column) to be shown as the table header (show col) from the pages table (table) which holds our PID on its UID field (foreign col). Example configuration: pid, pages, uid, title

Looks good but how is it ordered? Well, actually not at all. To do so use the 'order' option. We want to sort by title ascending so we extend our configuration: pid, pages, uid, title, title asc

But what's that? Pages already deleted and also hidden ones are shown? Well, of course, they are inside the pages table. How to change? Use the where part: pid, pages, uid, title, title asc, deleted = 0 and hidden = 0

Now we have what we want. Imagine we want to show the title and and pid instead – SQL cracks know: concat is what we want to use: pid, pages, uid, concat(uid, ' ', title), title asc, deleted = 0 and hidden = 0

Now our output is completely dead – why? Well, first of all because we used comas where they are not expected. We need to prefix them with a backslash. And secondly because the extension prefixes our columns with the table name in order to prevent confusion if our main and our foreign table have same colums, so our statement would contain something like page.concat(...) - not good! To prevent it doing so, prefix it with a #. New configuration: pid, pages, uid, #concat(uid\, ' '\, title), title asc, deleted = 0 and hidden = 0

Well done. One more thing: Our drop-down now offers only not-deleted and not-hidden entries. So far so good but what if an already existing entry has a hidden page on its pid field? It's not shown in the frontend (remember: we don't want to show hidden pages). SQL Frontend allows us to distinguish between adding/editing and viewing foreign keys. So we can say that our WHERE part form the foreign key is different depending on if the user only views it or wants to change it. Parts that shouldn't be in there when viewing can be surrounded with squared brackets. We want to show hidden ones but never allow deleted pages. New configuration: pid, pages, uid, #concat(uid\, ' '\, title), title asc, deleted = 0 [ and hidden = 0 ]

And last but not least: We have two or more foreign keys in our table – what should be do? Separate them with a semicolon: pid, pages, uid, title; cruser_id, be_user, uid, username

Don't forget to prefix otherwise-used semicolons with a backslash! In case you still receive errors or simply nothing, enable the debug mode that might help you a little.

Additional links (name: caption: link;) / ###fieldname### is sbst.

First of all: sbst means substituted!

If you want to create links out of various columns use this option. Give it a name (this is the one used in DATABASE > Show those database fields and links), enter the caption that is shown in the frontend and the link it represents. In the caption and in the link section all columns surrounded with ###_### are substituted.

An example – we list fe_users who have a homepage entered in the 'www' field. Basic configuration: link_www: click here to view my homepage: ###www###

Now in the fronend we have a link in each line saying ''click here to view my homepage' linked to the link on the field 'www'. Works but doesn't look very good. It's better to show also the homepage: link_www: ###www###: ###www###

And more links are separated with a semicolon (again here you may prefix various double points and semicolons with a backslash). Note that in editing mode links are not available.

In case the link part is numeric, it is supposed to be a page ID inside the current TYPO3 installation and the TYPO3 function to link to this page is called. This also works if the page ID comes from a database field. So in case the field ###www### contains a number, it is converted to the correct link (for example realURL speaking URLs, no_cache parameters, etc.).

Callback functions per column (column: function: (in|out);)

This is a very advanced setting for people who understand also a bit of PHP. If you want fields to be completely reformatted on output or even on input you can define callback functions that are called using the value before going into the database or before showing it in the table. The functions need to be defined in the extension directory (typically typo3conf/ext/mh_omsqlio/) and then in the pi1/ folder inside the file 'class.tx_mhomsqlio_callback.php'. Also there are further explanations about the functions itself.

The configuration here has to include the column (or link name) for which you want to use the function, the function name itself (without any brackets or class names) and one of the keywords in or out – indicating if this function should be called in input (into the database) or on output (before showing it on the fronend. Example: telephone: out_linkCcm: out

Note that in this example the out_linkCcm is the function name, the prefixed 'out_' is part of the function name and not a needed prefix. This example will be used for the column 'telephone'.

Hint: If you need more (various) column contents for your callback function a little trick can be used: Define a link where you put all the necessary information into the caption part. Then define the callback function for this link. Probably you should separate the values with a special character and inside your callback function explode it again. So, slower:

  1. Define a link: link_for_callback: ###uid###_###www###_###name###: foo

  2. Define a callback function: link_for_callback: myFunction: out

  3. Inside the function explode the values on underscores: explode('_', $_sValue)

There are already a few callback functions defined, maybe you could use one of those:

  1. in_phone

    1. inwards function that deletes all slashes and spaces and also replaces + with 00

    2. could be useful to reformat telephone numbers

  2. out_hidePassword

    1. outward function that displays stars instead of signs for hiding passwords

    2. in case of a CSV download the cleartext passwords get shown

    3. in case of editing the password CAN be edited, the stars are just a little barrier, nothing security-relevant

Since version 2.3.0 a separate callback file can be created which doesn't get overwritten every time the extension is updated from the repository. The file stored in the upload folder of your TYPO3 installation has to be in a certain form so you may just copy the sample file from the extension directory, pi1/class.tx_mhomsqlio_privatecallback.php to the uploads/tx_mhomsqlio/ directory. The extension then checks whether a file named class.tx_mhomsqlio_privatecallback.php exists inside the uploads/tx_mhomsqlio/ directory and if the class tx_mhomsqlio_privatecallback is defined. If so, this class is used (and has to be inherited from tx_mhomsqlio_callback), otherwise the 'normal' class.tx_mhomsqlio_callback.php inside the pi1/ folder is used. Remember that the class.tx_mhomsqlio_privatecallback.php inside the pi1/ directory won't be used at all, this is just a draft for you to understand how the new file has to look like.

Pre-defined values per column (column name: value;)

Basically this function does nothing else but predefining values for the database. These columns don't have to be shown, but could be, and if so, the user has the final say. Two examples for an easier understanding: On a page news entries can be edited using the SQL Frontend plugin. A pre-defined value may be set for the page ID of the news entries, even though the user should neither be able to see nor to edit it. Example configuration: pid: 152

In this case for every entry that is added or edited, the pid of this entry is set to 152, so the news entry is stored on this page. Another useful case could be the pre-definition of a field the user should be able to edit. For example a list of attendants to a party including a column indicating how many persons one will bring. Most of the time a '2' will go here but sometimes people come alone or bring more than just one person with them. The field should be shown but a simple persons: 2 will do the trick and write 2 as a default value into the field. The user might then overwrite and change or just accept it.

JavaScript code to be executed after sorting/page switching/autofiltering

You may enter manual JS code here (always use semicolons at the end since other code might be added) in order to update something everytime the list gets reordered, filtered or page switched. Basically this code is called every time the frontend view changes because of JavaScript (not on adding, not on searching, not on deleting, not on editing, etc.).

JavaScript code to be executed after editing/adding/deleting

Read the function above before. Code here is executed every time the frontend changes because of PHP. This is done on editing (well, on saving respectively), adding (the time you click the disk symbol) and deleting.

FILE HANDLING

Enable file upload(s) (column names; coma list)

All the other settings on this page only apply to fields that are listed here. Enter the column names which should be converted to file elements. In case you create the database table especially for SQL frontend, a text field would make sense here to store your file elements in. If you only allow one file, maybe even a varchar(255) is enough. Anyhow, a text field is always the safer way.

All the other settings on this page only apply to fields that are listed here. Enter the column names which should be converted to file elements. In case you create the database table especially for SQL frontend, a text field would make sense here to store your file elements in. If you only allow one file, maybe even a varchar(255) is enough. Anyhow, a text field is always the safer way.

File extensions that are permitted (coma list; eg: pdf,doc,txt)

Enter a list of file extensions which are allowed to be uploaded. If nothing is entered here, every type is allowed, which is not prohibited (see next setting). This field is case-insensitive and always works in combination with the next setting (prohibited file extensions).

Enter a list of file extensions which are allowed to be uploaded. If nothing is entered here, every type is allowed, which is not prohibited (see next setting). This field is case-insensitive and always works in combination with the next setting (prohibited file extensions).

File extensions that are prohibited (coma list; eg: exe,bat,com)

File extensions entered here are forbidden and not allowed to be uploaded. This field is case-insensitive and always works in combination with the previous setting (permitted file extensions). In case this list is empty, only files which are permitted (see setting above) are allowed to be uploaded.

Notice: Always both settings (permission and prohibition list) are taken into account. If both lists include the pdf extension, pdf files are not allowed to be uploaded since they appear in the prohibition list.

Maximum number of files allowed per item

In case this setting is used it defines the maximum number of items that can be uploaded per row per column. Meaning that if you have file handling enabled for two fields, 'a' and 'b', and there are already seven rows in the list, then every row may hold twice the maximum number of files you enter here. Once for item 'a' and once for item 'b'. Long story short: As it says in the title, this maximum number counts per single file upload item.

In case this setting is used it defines the maximum number of items that can be uploaded per row per column. Meaning that if you have file handling enabled for two fields, 'a' and 'b', and there are already seven rows in the list, then every row may hold twice the maximum number of files you enter here. Once for item 'a' and once for item 'b'. Long story short: As it says in the title, this maximum number counts per single file upload item.

If you leave this setting empty, no maximum number is set, thus there is no limit.

If you leave this setting empty, no maximum number is set, thus there is no limit.

Maximum size for one single file (insert value in kilobyte)

This is the maximum file size per file (not, as in the last setting, per file item). Do not try to enter any size characters here (like KB, MB or something like that), just enter a number that represents the kilobyte value. In case you want to allow 10MB, remember to calculate with factor 1024, not 1000. So 10MB are 10x1024 = 10240 kilobyte (enter 10240 into this field).

This is the maximum file size per file (not, as in the last setting, per file item). Do not try to enter any size characters here (like KB, MB or something like that), just enter a number that represents the kilobyte value. In case you want to allow 10MB, remember to calculate with factor 1024, not 1000. So 10MB are 10x1024 = 10240 kilobyte (enter 10240 into this field).

Overwrite existing files

In case a file with the same name is already inside the upload folder, then this file does not get overwritten. The extension tries to find a file name that is not used yet by extending the current name with an underscore and a numerous value. So foo.bar gets foo_1.bar, foo_2.bar, foo_3.bar or even higher, depending on which files do exist.

In case a file with the same name is already inside the upload folder, then this file does not get overwritten. The extension tries to find a file name that is not used yet by extending the current name with an underscore and a numerous value. So foo.bar gets foo_1.bar, foo_2.bar, foo_3.bar or even higher, depending on which files do exist.

If you do not want that, enable this setting, and foo.bar overwrites any existing file. Keep in mind that all mh_omsqlio content elements that use this setting write into the same directory. Lets imagine, you have the plug-in twice on your website, both working with the upload directory 'uploads/tx_mhomsqlio/media/'. One user then uploades foo.bar on one page. Another user uploades on another page also a file named foo.bar. If you have this option enabled, the second file overwrites the first one, no matter if they are coming from different pages. The identical upload directory is the key.

If you do not want that, enable this setting, and foo.bar overwrites any existing file. Keep in mind that all mh_omsqlio content elements that use this setting write into the same directory. Lets imagine, you have the plug-in twice on your website, both working with the upload directory 'uploads/tx_mhomsqlio/media/'. One user then uploades foo.bar on one page. Another user uploades on another page also a file named foo.bar. If you have this option enabled, the second file overwrites the first one, no matter if they are coming from different pages. The identical upload directory is the key.

Really delete files if deleted in SQL Frontend

In case a file gets deleted from the list of SQL Frontend, normally the file would not be really deleted but stays on the server. You can avoid that by enabling this option. Keep in mind, that if you have the previous option (overwrite existing files) enabled, really deleting the file could break another user's link to a file.

In case a file gets deleted from the list of SQL Frontend, normally the file would not be really deleted but stays on the server. You can avoid that by enabling this option. Keep in mind, that if you have the previous option (overwrite existing files) enabled, really deleting the file could break another user's link to a file.

Directory into which files should be uploaded (relative from TYPO3 root directory)

Starting from the TYPO3 home directory (where typo3conf, fileadmin, etc. is laying around) enter the path where the uploaded files should go. This folder has to be writable. Default is 'uploads/tx_mhomsqlio/media/' which is fine in case you have no clue where to put the files.

Starting from the TYPO3 home directory (where typo3conf, fileadmin, etc. is laying around) enter the path where the uploaded files should go. This folder has to be writable. Default is 'uploads/tx_mhomsqlio/media/' which is fine in case you have no clue where to put the files.

How to save paths into database

First of all, if you do not have any files in your database yet and do only use them in combination with SQL Frontend, 'no paths at all' is just fine, leave it with that!

First of all, if you do not have any files in your database yet and do only use them in combination with SQL Frontend, 'no paths at all' is just fine, leave it with that!

If you need the paths in any other way, this option might help you to specify how to find the elements. In all ways the files are separated with a coma. Lets have a look into the database if we want two files (file.ext and foo.bar) to be saved – what gets written into the used database column (as one string, no line breaks are included).

If you need the paths in any other way, this option might help you to specify how to find the elements. In all ways the files are separated with a coma. Lets have a look into the database if we want two files (file.ext and foo.bar) to be saved – what gets written into the used database column (as one string, no line breaks are included).
No paths at all
file.ext,foo.bar
Relative paths
uploads/tx_mhomsqlio/media/file.ext,uploads/tx_mhomsqlio/media/foo.bar
Absolute hard disk paths
/var/www/htdocs/cms/uploads/tx_mhomsqlio/media/file.ext,/var/www/htdocs/cms/uploads/tx_mhomsqlio/media/foo.bar
Absolute website paths
http://www.my-website.com/uploads/tx_mhomsqlio/media/file.ext,http://www.my-website.com/uploads/tx_mhomsqlio/media/oo.bar

Use special templates for various file extensions (TMPL: coma list;)

Basically this is the only setting on this FILE HANDLING tab that affects the normal output, not the editing view. It may occur that you want different files be presented in different ways. For example show image thumbnails but links to PDF files. How to achieve that? Using different templates!

Basically this is the only setting on this FILE HANDLING tab that affects the normal output, not the editing view. It may occur that you want different files be presented in different ways. For example show image thumbnails but links to PDF files. How to achieve that? Using different templates!

The revised template now contains three parts for file output. Two of them are just examples, you may enter a lot more here. The last one is the so-called fallback template, meaning that if for a file extension no special template is defined, then this fallback template is used.

The revised template now contains three parts for file output. Two of them are just examples, you may enter a lot more here. The last one is the so-called fallback template, meaning that if for a file extension no special template is defined, then this fallback template is used.

File output template are always called ###SHOW_FILE_tmpl###. The last part, tmpl, is the one that goes into the backend configuration. Hopefully it all gets clearer with an example:

File output template are always called ###SHOW_FILE_tmpl###. The last part, tmpl, is the one that goes into the backend configuration. Hopefully it all gets clearer with an example:
  1. We want images to be shown as thumbnails, word/writer, excel/calc, powerpoint/presenter and pdf files to be shown as direct links and any other files without links just as their filename.
    We want images to be shown as thumbnails, word/writer, excel/calc, powerpoint/presenter and pdf files to be shown as direct links and any other files without links just as their filename.
  2. We need two templates, one for images that shows thumbnails (we call it img view) and one for word/writer/excel/calc/powerpoint/presenter/pdf files that displays links (lets call it link view). All the others are summarized and collected with the fallback template.So what do we do? Define two new template parts with the naming scheme ###SHOW_FILE_name###:<!-- ###SHOW_FILE_IMG### begin → <a href="###LINK###" style="display: block;"> <img src="###LINK###" alt="###FILE###" style="max-width: 100%;" /> </a><!-- ###SHOW_FILE_IMG### end →<!-- ###SHOW_FILE_LINK### begin → <a href="###LINK###" style="display: block;"> ###FILE### </a><!-- ###SHOW_FILE_LINK### end →
    We need two templates, one for images that shows thumbnails (we call it img view) and one for word/writer/excel/calc/powerpoint/presenter/pdf files that displays links (lets call it link view). All the others are summarized and collected with the fallback template.So what do we do? Define two new template parts with the naming scheme ###SHOW_FILE_name###:<!-- ###SHOW_FILE_IMG### begin → <a href="###LINK###" style="display: block;"> <img src="###LINK###" alt="###FILE###" style="max-width: 100%;" /> </a><!-- ###SHOW_FILE_IMG### end →<!-- ###SHOW_FILE_LINK### begin → <a href="###LINK###" style="display: block;"> ###FILE### </a><!-- ###SHOW_FILE_LINK### end →
  3. As you can see, two markers are available: ###LINK### represents the relative link to the file, ###FILE### contains the file name as stored on the server. A third template is already defined, the fallback template:<!-- ###SHOW_FILE### begin → <div>###FILE###</div><!-- ###SHOW_FILE### end →
    As you can see, two markers are available: ###LINK### represents the relative link to the file, ###FILE### contains the file name as stored on the server. A third template is already defined, the fallback template:<!-- ###SHOW_FILE### begin → <div>###FILE###</div><!-- ###SHOW_FILE### end →
  4. Now, all we have left to do, is to specify, which template to take for which file. Therefore we enter a template name and a list with file extensions for each type. Since the fallback template collects all the file extensions which are not defined, we can leave that one. So our configuration (separated with a semicolon between configurations and a double point between template name and file extension list) looks like following:IMG: jpg,gif,png,bmp,ico,tif;LINK: pdf,docx,odt,xlsx,ods,pptx,odpThis means, that all images (namely jpg, gif, png, bmp, ico and tif) are using the IMG template (###SHOW_FILE_IMG###), so-called office files (namely pdf, docx, odt, xlsx, ods, pptx and odp) are using the LINK template (###SHOW_FILE_LINK###). All others use the fallback template (###SHOW_FILE###).
    Now, all we have left to do, is to specify, which template to take for which file. Therefore we enter a template name and a list with file extensions for each type. Since the fallback template collects all the file extensions which are not defined, we can leave that one. So our configuration (separated with a semicolon between configurations and a double point between template name and file extension list) looks like following:IMG: jpg,gif,png,bmp,ico,tif;LINK: pdf,docx,odt,xlsx,ods,pptx,odpThis means, that all images (namely jpg, gif, png, bmp, ico and tif) are using the IMG template (###SHOW_FILE_IMG###), so-called office files (namely pdf, docx, odt, xlsx, ods, pptx and odp) are using the LINK template (###SHOW_FILE_LINK###). All others use the fallback template (###SHOW_FILE###).
  5. One more important thing: Those template parts are used per single file. There is also a 'mother template' that shows all the single files on the marker ###LIST###. This template part is called ###SHOW_FILELIST### and does currently include only the LIST-marker meaning that all files are substituted with their template part and just appended to each other.By the way: This example is the default configuration!
    One more important thing: Those template parts are used per single file. There is also a 'mother template' that shows all the single files on the marker ###LIST###. This template part is called ###SHOW_FILELIST### and does currently include only the LIST-marker meaning that all files are substituted with their template part and just appended to each other.By the way: This example is the default configuration!