Knowledge Base - Tutorial Sobi2 CSV Import plugin
Welcome to this tutorial for the Sobi Import plugin. The screen captures are made with the current version of the plugin (April 2010) and with Sobi 2.9.3, it is possible that some screens are slightly different on your version.
Also screen captures are made on a system in French, but important information is translated in the text.
In this tutorial, we have worked with the spreadsheet OpenOffice/Linux.
Note the file of this tutorial is specific to our configuration, with the fields of our Sobi2. So you can not use this example file directly on your configuration.
Remember that you can fly over the texts in the backend, a tooltip appears with a contextual help.
It is possible to work on a clone of Sobi2, for this, simply clone the plugin with the official tool provided by Sigsiu.net.
You just download the plugin. For that you received by email a download link that contains the order number like 1234567890. Keep this email, with them you can download the updates.
Open your site backend, and select the menu Components > Sobi2. Once in the component Sobi2, go to the side menu plugin > Plugin Manager.
Click the browse button and select the file plugin_import.zip. Click install and the plugin should be installed. In case of installation error:
- Check writing privileges (CHMOD) in the folder 'com_sobi2/plugins' in 'components' and 'administrator / components'
- Try to install an official plugin like Gallery from Sigsiu.net
- Perform a system check in Sobi and correct any errors
Once installation is complete, you will be asked for for an order, enter the number which we mentioned above. Click save.
You will now see a message in green indicating that the registration is correct and that the version is updated. Note: Your version may be newer than the server, because we do not publish necessarily minor update.
There is only one tab can be configured, it is 'Settings'.
Explanation of parameters:
The separator columns charter, like ';' or '|'. Example:
Separate the values in columns (lists, checkbox groups). For example, a column contains a value of field 'Checkbox group' should be so in the same column enable multiple values:
- Standard value 1;Standard value 2;option_val_01#option_val_03#option_val_04;Standard value 3;Standard value 4;
Owner of entries inserted. You can leave 'anonymous', and set a different owner For each entry in the CSV file, or select the same owner for each entries here, or leave anonymous.
Defines the format of categories:
- Text: the name of the category. Warning the first occurence is used. If you use the same sub category name in multiple categories, then the first sub cat with the goos name will be used. If you have unique names of categories there is no problems.
- Identifier: the id of the category. You find the category ID into the category manager of Sobi
- Mixed: the 2 methods mixed, if the entered values is a number, the plugin use the id other wise it will search the name from the entered text
Save the parameters.
Go on the tab 'Actions'. We will generate the CSV file (CSV template) depending on your installation. To do this, simply click on the button 'Create CSV file'. A dialog appears, it may be different, the file may also register directly, or open, it all depends on what OS you are using and configuring your local machine.
We will in this tutorial, save the file 'as is' on the desktop.
Then we'll open this file, why we use the free OpenOffice suite, feel free to use your usual tools. In this case the options will be slightly different but the result (CSV file) will necessarily be similar in format. You can download the file from the example here in csv, or here in txt to open it easily with Notepad.
- files -
OpenOffice opens a dialogue because the program detects that the file is not a native spreadsheet. The program asks us to enter the settings file.
We must choose the separator according to the options we have selected in the 'Settings' tab of the plugin, in our case the semicolon ';', and text delimiter (usually the program offers '"'). If it has not detected, it must indicate that a file is UTF8. Validate, and the file opens.
It is found that the cell A1 contains TITLE, A1 CAT_1, A2 ..., in short, the first line contains the header. Then underneath, you see some helps, such as the sample path of YOUR server for images and icons, and the possible values for listboxes (depending your custom fields).
A first set of header is fixed, it is these fields:
- TITLE: The title of the entry to insert. Depending on the setting to allow duplicate title of Sobi, duplicates in the files or duplication between the file and the existing entries will be rejected. It would be necessary to rename the entries in the CSV file.
- CAT_1: Enter here the name or the id of the category. It must enter a single category. If the entry must be in multiple categories, use the following columns (CAT_2, ...). Beware, the limit of 5 categories is imposed by Sobi. Warning, the categories need to be existing in Sobi.
- CAT_2 to CAT_5: idem
- ICON: This is the icon value in Sobi. You need to upload the needed images into a server directory (with the media manageror ftp client), then enter the path to that file using the example given path in the CSV. Then the plugin will COPY the image in the proper directory and resize the image within the parameters of Sobi. You will then delete the image, because the plugin does not change the images provided.
- IMAGE: Same as ICON but for the image value of Sobi
- META_DESC: This is the meta description of the entry
- META_KEY: These are the keywords meta of the entry
- OWNER_USER_ID: This is the id of the owner of entry. If this value is zero, the parameter of the plugin (anonymous or name) will be used.
The second set of headers contains exactly the custom fields used Sobi2 from your installation. Nothing prevents you from deleting the columns that you do not want to import values. The column headings (13#field_color) is composed of the id of the Custom field, an internal separator and the field name.
Fill in the entries, one per line, as indicated above and according to your data (you can copy and paste from another file!). Warning, must still remove all the examples of the CSV (eg sample path and the sample values listebox). You see here the example of our file here to csv and on txt format.
He must now save the file in CSV format, NOT the native format of your spreadsheet (NOT xls...). To do this in OpenOffice, you have to 'save as ...', and click the check box 'Edit filter settings'.
A dialog to choose several options appaers. We must choose the selected column separator in plugin settings (eg ';'), and do not use text delimiter (NOT '"'), NOT use the 'fixed column width' option, and finally, choose the file format UTF8.
We are now able to test our file. For that you must click on the 'Browse' and select your CSV file.
Then just click on 'Test CSV', the plugin test file now, if this is correct, a message 'Ready to import' appears, and the file is now known from the plugin (the file name is shown). Otherwise you have read the error message to correct the errors.
If you enter values From... To... beside the test button, you will see the values that will be inserted.
We must now click on the 'Import' button and the import process begins, depending on the number of entries it can take time, be patient.
You can still click on 'Recount' to count again the entries, dump Sobi caches is also advised.