To import images using Form2Content Article import requires some background knowledge due to the folder structure used by Form2Content. This article explains how this works and how to use it.
Form2Content Article import supports import of various content fields. So lets start with the list of content fields RO CSVI supports in Form2Content article import.
- Image
- Displaylist
- Databaselookup
- Databaselookupmulti
- Hyperlink
Import of Image field
In the above list we are going to explain how we can Import a Image field. It is bit different from other fields. The options offered with Image field are
- filename
- widthThumbnail
- heightThumbnail
- width
- height
- alt
- title
So in case you are importing a Form2Content Image content field then you can set the values in the import file as
filename:image.jpg|widthThumbnail:200|heightThumbnail:200|width:400|height:400|alt:sample-image|title:Sample image
Kindly note that not all the fields are necessary. Add only the needed field separated by | in the above format.
Now to explain on how the path of the image is constructed, The base path of an image comes from Form2Content configuration page which defaults to 'images/stories/com_form2content'. The rest of the path is based on Project ID and Form ID of the article like '/p2/f12/' where 2 is the Project ID and 12 is the Form Id. So the entire image path will look like 'images/stories/com_form2content/p2/f12/image.jpg'. RO CSVI looks for the image in the location to link it to the articles.
Since Form2Content constructs path for images based on Project ID and Form ID, it is neccessary to import projecttitle field to get Project ID and alias field for getting Form ID in the import file.
Example content for import of image
projectid;title;screenshot;catid
4;Sample Article content;filename:image.jpg|widthThumbnail:200|heightThumbnail:200|width:400|height:400|alt:sample-image|title:Sample image;203
Import of other fields
The fields databaselookup and databaselookupmulti are same by nature of what it does except that you can import multiple values sepearted by | for databaselookupmulti field. These fields hold the Reference ID value of Joomla content table. You can use the title of the form which uses the Joomla content id as reference.
Say if more_articles is a Form2Content databaselookmulti content field type. An example for importing this field will look like below.
projectid;title;more_articles;catid
4;Sample Article content;Sample article content1|Sample article content2|Sample article content3;203
Like Image content field, CSVI has standard parameters to import hyperlink field. The supported parameters for hyperlink field are
- url
- display
- title
- target
The format of using these fields is same like Image field. Values separated by : and fields separated by |. An example format is given below
url:http://testsite.com|display:|title:Test site|target:_top