Knowledge Base - Gateway for Form2Content

 

What is it

Form2Content is a powerfull tool with adds templating, custom fields and other features to article creation in Joomla!.

Using Geocode Factory's gateway plugin you can associate one or more sets of coordinates to each of your Form2Content articles. In this way, you can display the locations of your Form2Content articles as markers on a map.


Form2Content Preparation

Overview

To geocode your Form2Content articles using the Geocode Factory Form2Content gateway plugin you will need to use your Form2Content fields. Geocoding simply means to assign the proper coordinates for their location.

If you are using Form2ContentPro, you will get your articles geocoded by using the special "Geo Coder" custom field. You only need to create one such field. This special field includes latitude, longitude and address information (1 line).

geocoder field type

If you are using Form2Content lite, you have two options on the ways to get your articles geocoded:

1
Address fields

You can use address fields like street, postcode, city, etc and (automatically) fetch the coordinates based on the data in these fields (using Geocode Factory 5).The address fields of are field types of your choice. For instance they can be drop-down selection or textbox field types.

2
Coordinate fields

Or you can simply use coordinate fields (latitude and longitude) and input the coordinate values directly (manually). If you use this option, you don't need to create address fields.

Please note that in both cases for Form 2 Content lite you will need to create two coordinates fields. These fields are of course latitude and longitude. Even if you use address fields to fetch the coordinates, you will need a longitude and latitude field where the coordinates data from the geocoding process will be stored. The process of creating coordinate fields is very similar to creating address fields as we shall see.

 

Form2Content Content Types

Follow the following steps to create the fields before configuring the Form2Content gateway plugin.

Once inside your Form2Content component in the Joomla administration area, click on the "Content Type Manager" option from the left sidebar.

You should then see a list of your Content Types.

f2c-content type-manager

If you have no Content Types you should create one first. You can create a new F2C Content type by clicking on "New" at the top of the screen as seen on the image above. After this, give it a name and save it right away (please consult the Form2Content documentation for further information on creating a Content type).

In the Content Type Manager list, click on the fields button which is found second column next to the content type you wish to use. In the example of the above image the Content Type is called "Simple article example". This will bring you to the field manager where you can add your new custom fields.

 

Form2Content Custom Fields

f2c-new-field-button

Now, to add a new custom field click on the "New" button.

 

If you're using Form2ContentPro:

In this case you only have to create one "Geo Coder" type custom field.

 f2c-geocoder-new-field

Field Name: Give a name to your field.

Field Caption: Give a name that will appear in the form of the front end (caption) for this field.

Description: Enter the "Description" settings as you like (optional).

Field Type: In this case the field type is a "Geo Coder" field.

Finally, save your new field. Form2Content is now ready!

 

If you are using Form2Content lite:

1
Address fields

Note: If you want to use coordinate fields (latitude and longitude) and input the coordinate values directly (manually), you don't need to create address fields but only coordinate fields (as described in point "2" above).  So you can skip this part and go straight to number 2.

First address field: Street

new-address-field-f2c

Field Name: Give a name to your field.

Field Caption: Give a name that will appear in the form of the front end (caption) for this field.

Description: Enter the "Description" settings as you like (optional).

Field Type: In this case the field type is a "Simple line text (textbox)" field.

Finally, save your new field and repeat these steps for as many fields as you like (ex: postcode, city, state, country, etc).

 

2
Coordinate fields - latitude and longitude

First coordinate field: Latitude

f2c-coordinate-new-field

 

Field Name: Give a name to your field.

Field Caption: Give a name that will appear in the form of the front end (caption) for this field.

Description: Enter the "Description" settings as you like (optional).

Field Type: In this case the field type is a "Simple line text (textbox)" field.

Finally, save your new field and repeat these steps for the Longitude field as well.

Form2Content is now ready!


Installation

Overview

Note: In order to use Geocode Factory's Form2Content gateway plugin, you need to have Geocode Factory 5 component already installed.

The gateway plugin for Form2Content is not included in your Geocode Factory 5 package by default. This file is an optional extra:

  • plg_geofactory_gw_f2c.zip: Form2Content gateway plugin

 

Access, Download and Installation

The Form2Content Gateway plugin file "plg_geofactory_gw_f2c.zip" is installed using the standard Joomla installer.

Please read the Download, install and update manual for more information.

 


Gateway Plugin configuration

Inside the joomla “Plugin Manager” you will find the Gateway plugin you installed. To locate it more easily, you can use the filter by adding the text “geocode” for example, like in the following image.

 joomla-plugin-manager-f2c

Geocode Factory - Form2Content Gateway plugin

Configuring the Form2Content Gateway plugin you have only the following option:

joomla-f2c-plugin-view

Colors of the lines between owners and content markers: If you choose to use the "Draw Lines" option (Specific Settings tab in Markerset manager) of Geocode Factory for the Form2Content gateway plugin, you can configure the color of the lines drawn between the markers here. To do so click on the hexadecimal color code and select the color from the palette pop-up. Or alternatively, you can type in the hexadecimal color code of your choice in the field directly.

If you do not use this specialised feature, then you do not need to configure anything in this plugin.


Pattern manager and Form2Content articles

When you enter the pattern manager you will see that one default pattern for Form2Content articles is already available. This pattern was created automatically when you installed the plugin.

 pattern-manager-f2c

Click on the "Default - Form2Content.." pattern and go to the third tab "Assign fields to the values".

Location data assignment from your Form2Content fields

If you're using Form2ContentPro:

geocoder f2c pro pattern

  • For the Latitude and Longitude options select and assign the one "Geo Coder" field you created from the dropdown menu options (ex: "GEO lat/long" in this documentation case).
  • For the address fields there is nothing to assign in this case, you can leave the rest of the fields empty.

If you're using Form2Content lite:

As we mentioned before, in order to geocode your Form2Content lite articles using the Geocode Factory Form2Content gateway plugin you need.

1-) Address fields to fetch the coordinates: You can choose which fields you wish to assign for your needs. Not all fields apearing here need to have a selection. In other words, you can choose not to use some field assignments. In such a case, for the unused address fields the default option "Select" has to be selected.

2-) Coordinate fields to store the fetched data in: The coordinate fields can only be textbox types for them to show up as an option in the associated dropdowns of the latitude and longitutde fields. Please note that these fields will be used to store the coordinates fetched from the address fields above. You can also use these fields to manually input the coordinates from the f2c article entry form directly. In such a case you don't need to create address fields and so you will not need to associate address fields in the Form2Content pattern either.

 

1-) Address and coordinates fields case:

f2c-assign-pattern-address

 

 

  • For the Latitude and Longitude options select and assign the respective fields you created from the dropdown menu options (ex: "Latitude" and "Longitude").
  • Assign the proper address fields to the Form2Content pattern fields you have created (ex:street, city, country).

2-) Coordinates fields only case:

f2c-assign-pattern-coords

  • for the Latitude and Longitude options select and assign the respective fields you created from the dropdown menu options (ex: "Latitude" and "Longitude").
  • For the address fields there is nothing to assign in this case.

 

Markerset

The specific settings tab

The options on this tab are generated based on the currently selected pattern. In this tab you can select various different filters for the current markerset allowing you to further customize your data pool. You may also select some other options which are not filter-related.

 specific-settings-markerset-f2c

Filter Generator: Here you can introduce SQL queries to filter out your results. The Geocode Factory query will be build with your optional filter. For instance, in the example above the condition is that the data in the field "f2c_special" has to be equal to "Yes". This way, the Form2Content entries which meet this condition will be used only. The idea in this case is to have a checkbox field (f2c_special) where the authors choose whether they want to have their entry displayed on the map "Yes", or not "No". Of course this field could be an administrative one instead, ior it may be serving some other purpose as well. It all depends on what you want to achieve.

Warning: The use of this feature is the most common source of errors that result in no markerset being displayed! Remember that here you are adding a clause/condition affecting the mysql database query. Each wrong or missing charter/quote will cause an error. Handle with care!

Select image field: Here you can select the F2C field that will be used as the "Image" placeholder in the map templates.

Select sales area field: Here you can select the CB field that will be used to calculate the "Sales Area". It has to be a numeric value/field. See the Geocode Factory advanced features article to better understand this functionality

Categories to include: Here you can select the categories from which to choose the article markers to display on the map. You can enter many Form2Content categories.

Include child: Here you can select if you want to include articles from child categories.

Entries to load: Choose the status of the articles to display, ex: published.

Lines owners entries-events: Select if you wish to Draw Lines between the markers of the owners (authors) of the Form2Content articles and their articles.

Enable Auto-Category: With the auto-category feature enabled, the markers that will be displayed will be articles belonging to the categories you are currently browsing only (and child categories as well). This option is used to get a functionality typically seen in directories.

As long as there are tests, there will be prayer in public schools

 

Applies To

Geocode Factory 5