A RolandD Cyber Produksi Product
This is a step by step instruction on how to import fields into SOBI2 using CSVI SOBI.
Fields are labels you can create yourself in SOBI2 so that the layout can be completely customized.
The fields can be found by taking the following route: Components → Sigsiu Online Business Index 2 → Configuration → Custom Fields Manager
This is where new fields can be added or existing ones can be modified. It is important to know that fields are build up from 2 sections:
The field name is unique. For each language you can have a translation stored, this is called the language_langkey. The language_langkey is the field name and is the same for every language in the system.
To know to which language the language_langkey belongs we need to specify the language_sobi2lang. This makes a unique combination. There can always only be 1 set of language_langkey and language_sobi2lang. The name of the language can be found the Language Manager.
To localize the field name, it can be assigned a label this is called the language_langvalue. When choosing the language set, the associated language_langvalue will be retrieved and shown.
Each field is put into a section, currently there are only 2 sections to choose from:
The section is identified as language_sobi2lang, standard this is always fields.
The field data contains all the characteristics that can be specified when editing or adding a new field. This is explained in the How to import field details? tutorial.
To create the import file this example will use the spreadsheet program Calc by OpenOffice.org because it is very flexible with delimiters.
The first row will contain the column headers. Column headers tell the program what is going to be imported and are essentially the supported fields. Earlier in this tutorial the fields that can be used are already mentioned.
The first row will look like this
| language_langkey | language_langvalue | language_sobi2section | language_sobi2lang |
|---|
Now CSVI SOBI knows what is going to be imported
This row will contain the first real data to be imported. CSVI SOBI works from the idea that if a field already exists it is updated, otherwise created. A new field date of birth will be added. Important to know is that each field must always start with field_. The new field to create will be field_date_of_birth.
| language_langkey | language_langvalue | language_sobi2section | language_sobi2lang |
|---|---|---|---|
| field_date_of_birth | Date of birth | fields | english |
Assume the system has another language, Dutch. A field for this language must be created also.
| language_langkey | language_langvalue | language_sobi2section | language_sobi2lang |
|---|---|---|---|
| field_date_of_birth | Date of birth | fields | english |
| field_date_of_birth | Geboortedatum | fields | dutch |
More rows can be added as many as there is a need for. The file can eventually look like this:
| language_langkey | language_langvalue | language_sobi2section | language_sobi2lang |
|---|---|---|---|
| field_date_of_birth | Date of birth | fields | english |
| field_date_of_birth | Geboortedatum | fields | dutch |
| field_place_of_birth | Place of birth | fields | english |
| field_place_of_birth | Geboorteplaats | fields | dutch |
After all fields have been added, the file can be saved as a CSV file.
In Calc, click on File → Save as. In the dropdown box Save as type select Text CSV (.csv) and check the box before Edit filter settings. Give the file a name, for example fieldimport.csv and click on Save.
First a warning will appear which can be ignored by clicking Yes. Now a dialog box appears asking what delimiters to use. The recommended values are:
Click on OK and the file is saved.
To import the file there first needs to be a template created with settings to be used during import.
In the Joomla back-end click on Components → CSVI SOBI → Templates. The list of available templates will be shown. In a clean installation some sample templates will be shown. Select the 1. Field Import template and click on Edit.
The template wizard will now show up. All options have already been set. Click on General Settings to verify the same delimiters are set as used for the saved file. After all has been verified, click on Save. At the template list click on CSVI SOBI.
From the control panel, click on Import. On the import screen, first choose the template to use for import. Select here 1. Field import.
The file to import can either be uploaded or read from the local file system. Click on Browse to select the file that was saved earlier.
Click on Import.
A preview of the import will be shown first if this option is enabled in the template settings. On the preview page click on Import to continue importing the file.
A result screen is now shown with the results of the import. At the bottom some debug information is printed. This is also an option in the template settings and is usually only used for troubleshooting.
If there were no problems during the import, the fields are now shown in the Custom Fields Manager in SOBI2.
This concludes the tutorial on how to import fields.