A contact form at the bottom of an article, a registration form in the middle of a service page: since version 1.0.5 you place it without leaving the article editor, without creating a module by hand and without writing any code.
What you need
- Formulus 1.0.501 or newer. The package installs and enables two plugins for this: Button - Formulus and System - Formulus.
- Joomla's TinyMCE editor, the one installed by default.
The button
In the editor toolbar, click Formulus: place a form. A panel opens on the right, titled Place a Formulus form. It has three tabs: Layout, Element and Reuse.
The form is placed where the cursor is. Click in the text first, at the spot you want.
Layout: a new form
The tab offers eight templates: Contact, Quote, Registration, Call back, Application, Booking, Survey and Newsletter. They are the ones from the chapter Creating your first form, with their fields, the CAPTCHA and the consent boxes already in place.
- Click the template you want. A new form opens in a large window, with the template's fields.
- Give it a title. The field is empty: the template's name only appears there as an example.
- Adjust the fields if you wish, then click Save & Close.
Formulus then creates the form and its module, and places the form in the article. Close creates nothing: you go back to the article as it was.
This tab exists only in the administrator, and only for someone allowed to create a form.
Element: a form that already exists
This tab lists the site's forms. Next to the one you want, click Place: Formulus creates its module and inserts it in the article. An unpublished form is marked unpublished.
Reuse: a module that already exists
This tab lists the site's Formulus modules, in two groups: In this article and The other Formulus modules. Place inserts the chosen module without creating a new one. The button becomes Placed when the module is already in the article.
Use it to show the same form in several articles: it is the same module, so there is only one record to maintain.
From the site
If you write your articles from the site (the site's edit form), the panel has no Layout tab: forms are created in the administrator. There you place an existing form, or a Formulus module of the site.
The card, in the editor
In the text, the form appears as a card named Form, with the form's title. It is not the form itself: it is its place in the article.
- The handle: grab the card and drop it elsewhere in the article.
- The plus, above and below the card: places another form at that spot.
- The arrows: move the card up or down. On the keyboard, Alt + Shift + Up arrow or Down arrow.
- Edit: opens the form in the large window, on the Fields tab. From the site, this button opens the module's settings.
- Preview: shows the form as the site displays it, with your template's CSS (Corpus, Cassiopeia or another), at the real width of an article column. If that width could not be measured, the preview takes the window's width and says so.
- Remove: takes the card out of the article.
Removing a form
Remove opens a small window: What to do with the module?
- Keep it: the module is not deleted. It stays in the Reuse tab, ready to be used again.
- Delete it: the module goes to the modules trash. The form itself stays, with its answers.
If the module is also placed in another article, Formulus says so (This module is also placed in: ...) and keeps it, whatever you choose.
The trash acts when the article is saved. If you do not save, or if you undo with Ctrl+Z, nothing moves.
What Formulus writes in the article
Formulus puts Joomla's own tag in the text, {loadmoduleid 150} (the number is the module's number). It stays readable in code view, and Joomla replaces it with the form when the page is displayed. The card exists only in the editor.
In Content → Site Modules, the module that was created carries a note saying where it is placed (Article 3, "Title") and a position of its own, of the form formulus-article-3. They help you find your way when the site has many forms. Do not change that position: the article would no longer find its module.
A form placed in an article behaves like the one in a module: same fields, same protection, and after sending the visitor stays on the page they were on (see the chapter Showing the form on your site).
The form's heading in the page
Set the module's Heading level according to the article's subheadings: under H2 subheadings, take H3. To change it, open the module from Content → Site Modules.
Up to date for Formulus 1.0.508.