About Form2Content Forms & Fields

Form2Content forms are used to collect data to generate Joomla articles. Each content type has it's own form. Each form can have as many fields as you like. You can access the Fields Manager by clicking on the  in the Content Type Manager. Please read about article templating on how to get the data from the forms into your Joomla article.

Database lookup (single MySQL query)

Use a database query to add a single select list to a F2C submission form. Can be used to generate 'relations/links' between Joomla articles. This field should only be used if you understand MySQL queries and have a thorough understanding of Form2Content templating.

Image gallery

Database lookup field options

Template parameters available

{$< FIELDNAME >} = value (Joomla article id in example below)
{$< FIELDNAME >_TEXT} = text (Joomla article title in example above)

The following parameters can be used in the custom SQL query:
{$CURRENT_USER_ID}
{$CURRENT_USER_GROUPS}
{$LANGUAGE}

*(where < FIELDNAME > = the unique field name filled out in the settings)

Article template example

The database lookup field works very similar to the Single select list. It has a value and a text string. The content depends on your custom MySQL query. In most cases (and the examples used) this will be the Joomla article ID and title. The SQL query for this field should select two fields for a list of items, the first one being a unique value for the item, the second one a description of the item. You are not allowed to use a wildcard (*) in the query.

The following query can be used to fill the dropdown list with all the published articles in your database:

SELECT id, title FROM #__content
WHERE state = 1
ORDER BY title ASC
See the Database Lookup (multi-select) field for some more SQL query examples.

Database Lookup field settings

The above images show the possible settings of the field.

Setting Description
Display as Specify how the field will be presented to the user. Choose between "Dropdown list" and "Radio button list"
Show empty choice text Display a text to the user when no choice has been made yet?
Empty choice text The text to be shown when no choice has been made (e.g. Please make a choice...).
SQL Query

The SQL query for this field should select two fields for a list of items, the first one being a unique value for the item, the second one a description of the item. You are not allowed to use a wildcard (*) in the query.

 

Attributes Attributes to apply to the select field (e.g. class="dropdown")

F2C Cheat-sheet

An overview of all template parameters (placeholders for your form data). These are used in your F2C intro and main template to parse the data from your submission forms into the Joomla article.

Download

Footer

Form2Content, a Joomla CCK Documentation © 2010 - 2015 Open Source Design | Powered by Form2Content