How to import entries?
This is a step by step instruction on how to import entries into SOBI2 using CSVI SOBI.
What are entries?
Entries are the actual content of SOBI2. They contain all the data that is input into the system and is shown at the front-end.
Where to find the entries?
The entries can be found by taking the following route: Components → Sigsiu Online Business Index 2 → Entries & Categories → All Entries
How to manage entries?
For each field the data can be imported via the entries import. Each entry consists of entry data and entry characteristics. The data fields are flexible and depend on what fields have been created in SOBI2 and the characteristics are fixed fields. Since the data fields depend on user created fields it is not possible to list them on the availablefields page. However you can still find out what fields you can use by checking the template fields in CSVI SOBI. In a standard installation click on Components → CSVI SOBI → Templates. Now select the 03. Entries Import template and click on fields. The dropdown box will have all available fields.
Identifying the correct field
There are 2 ways to identify to which entry is being imported. First is the entry target="_blank" title and second is the itemid. Either can be used to tell CSVI SOBI which field you are importing. In case the entry target="_blank" title does not exist, a new entry will be created.
Creating the import file
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
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
| entry_title | entry_approved | entry_background | entry_field_city | entry_field_profession |
|---|
The last two fields are user created fields. Now CSVI SOBI knows what is going to be imported
The second row
This row will contain the first real data to be imported. CSVI SOBI works from the idea that if an entry already exists it is updated, otherwise created.
| entry_title | entry_approved | entry_background | entry_field_city | entry_field_profession |
|---|---|---|---|---|
| D. octor | Y | sand.gif | Smalltown | Doctor |
The third row and so on
More rows can be added as many as there is a need for. The file can eventually look like this:
| entry_title | entry_approved | entry_background | entry_field_city | entry_field_profession |
|---|---|---|---|---|
| D. octor | Y | sand.gif | Smalltown | Doctor |
| N. urse | Y | sand.gif | Smalltown | Nurse |
| T. ree | Y | sand.gif | Smalltown | Comedian |
After all fields have been added, the file can be saved as a CSV file.
Saving the import 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 fielddetailsimport.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:
- Field delimiter: ^
- Text delimiter: ~
Click on OK and the file is saved.
Importing the import file
To import the file there first needs to be a template created with settings to be used during import.
Creating the template
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 03. Entries 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.
Doing the import
From the control panel, click on Import. On the import screen, first choose the template to use for import. Select here 03. Entries 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.
Verify the import
If there were no problems during the import, the field details are now shown in the Custom Fields Manager in SOBI2 when editing a field.
This concludes the tutorial on how to import entries.
