Contact Form

With a contact form the following question arises: "Is this content?". I think it is, which is why I have written it as a sub chapter of managing content.

On a contact form it first becomes obvious that something like a CMS is being used. Manually created HTML pages cannot send emails as this requires a script language like PHP, for example, and a configured server. PHP scripts can be embedded as contact forms into HTML pages, but then that part of the website will often look different from the rest of the site. In Joomla! the contact form is already integrated and you "only" have to configure it.

Ususally, if your Joomla! is running on a web server at your provider, you won't have problems with sending emails. Locally, it's a bit more difficult because you would have to set up a mail server first. Generally, this is not a problem but it isn't really necessary. ;-)

Joomla! sends emails in different ways. You will see an overview of this in Global Configuration Server (Figure 1). Naturally, you would use the standard activated PHP Mail function. (see chapter Website and content configuration).

cocoate.com/node/10306

Figure 1: Mail Server Settings

Creating a contact

In order to include a contact on your site you need at least:

  • a contact category
  • a contact
  • a link in a menu

Maybe you still have a category from the example data (Sample-data contact). If not, go ahead and create one. In the next step you will create a new contact. To do so, open Components Contacts in your administration area and click on the icon New. Then fill in the appearing form (Figure 2). I have labeled some areas in the screenshot for better orientation.

Contact form 2

Figure 2: Create contact

  1. The first and last name of the contact person, or the name of the department or company if it is not a person. The contact can be connected with an existing user account. It has to be assigned to a category, should be public (State = Published) and presumably not appear on the frontpage (Featured = No).
  2. The text area can be used for additonal information, e.g. opening hours or jurisdiction.
  3. The Publishing Options relate to the user who can later make changes to that content, who created the content, and the timing for publishing. The latter is used rather seldomly for 'normal' websites.
  4. In Contact Details there are numerous fields available, which you can choose to fill in or leave blank.
  5. In Display Options you decide which fields will be displayed. This area is important as you specify here whether a contact form will be shown or not (Show Contact Form). You can also specify whether the sender should receive an email copy and you'll be able to configure some spam protection settings (Banned E-Mail, Banned Subject, etc). Against "real" spammers, however, this protection is rather "pathetic".
  6. In the field Contact Redirect, you can enter another email adress to which the contents of the form should be sent.
  7. The Metadata Options are, like the Publishing Options, available on each single page (see chapter Search engine optimization).

Creating a menu item

You now have a contact but still no form on your website. That is exactly what we are going to create in this next step. Due to the fact that you can link nestable categories to contacts, you may either have a single contact form or many of them. It is definitely possible to create a contact form for each employee of a big company like Volkswagen (approx. 370,000 employees). How does such a dynamic CMS display this on a website?

To manage this, Joomla! has its own Menu Manager with different layouts. In the Menu Manager, you get to decide whether you want to have a list of contacts or categories or just a single contact form. At first glance this may seem somewhat confusing but it is well thought out and helpful.

Let's link a single form in the menu for the contact we have just created. Open Menus - Top and click the New icon. You need three things for a menu link:

  1. the Menu Item Type (type of link) for displaying the site and, depending on your choice, a contact or a category
  2. a text displayed as a link
  3. the menu, in which the link should appear

For number 1, click on the Select button next to the field  Menu Item Type. A window will open and you will see a choice of types. Click Single Contact (Figure 3).

cocoate.com/node/10306

Figure 3: Choice of menu types

The window will close again. Since you only want one contact, you will now have to choose the contact in Required Settings (Figure 4).

Choose contact

Figure 4: Choose contact

At last, insert the text for the link (Menu Title) and then save everything. The menu is already registered correctly by opening the form. On your website, an additional link in the Top Menu should be appearing, which is linked to the corresponding contact (Figure 5). You can get to the actual contact form by clicking the plus sign in the right field. Now you can send messages via your website.

Contact form

Figure 5: Contact at website

Contact Form

Figure 6: Contact form

Comments

Thank you for this. I am a beginner and found this very helpful.

Hi, is it possible to have an option to publish the question and the answer in a page (which can be viewed by everyone)