Why use Article Templates (& parameters)?
Form2Content needs to get the data from the forms into the Joomla article. To accomplish this we use the so called "article templates". For each field you use in the form we add a "placeholder" in the template. These placeholders we call template parameters. When you save your form the placeholders are replaced with the field data thus creating your article content.
Article templates are part of the power and flexibility of Form2Content since it gives you the ability to create the same article layout for each Content Type. Because all the article html, plugin and other logic is in a template your end user just needs to fill out a simple form. At this point we assume you have read how to define a Content Type and how to add fields to your form.
Remember the basic working of Form2Content:
Default templates ... just to get started
Form2Content creates default article templates in order for users to immediately experience the working of Form2Content. Whenever a content type is created, F2C automatically generates a default template set (intro and main) and links to it. As a result, when you submit your first article with F2C it will actually generate a Joomla article since there is a template present.
Please read how to use your own custom article templates.
Smarty template engine
We use a so called template engine to render (paste) the data from the forms into the article templates. The template engine allows us to use a simple syntax (template parameters) to assign the places where the field information will be pasted.
If there is a text area (field type) in the F2C submission form called "introduction", users can add plain text into the text area. Now if we want to show the text in our article we need to add the following Template parameter to our introduction template.
The Smarty template engine also allows us to do many other things like only use the first 200 characters of the text. In this case the template parameter would look like this:
Since Smarty is 'smart' it will leave the last word in one piece.
One of the reasons we have chosen Smarty is because of the active support website and documentation. Please follow the following links to the Smarty website for extensive documentation.
F2C Template location
The Form2Content templates are saved in: < website root > /media/com_form2content/templates