Video import
As for every video, a preview image is needed as well, the video import, in general, is an extension of the image import.
Roles
For both images and videos, Magento provides so-called roles that can be used to define where the image or has to be rendered.
If necessary, the default roles can dynamically be extended. W henever a new role has been added, Pacemaker has support for it by adding new columns that match the role name.
By default, the following roles are available and can be used to define which role an imported image or video should have.
Role | Description |
---|---|
base |
|
small |
The small image is used for the product images in listings on category and search results pages and displays
the product images needed for sections such as for Up-sells, Cross-sells, and the
|
thumbnail |
Thumbnail images appear in the thumbnail gallery, shopping cart, and in some blocks such as Related Items.
|
swatch |
A swatch can be used to illustrate the color, pattern, or texture. Example size: 50 x 50 pixels
|
File Structure
The file structure for images and videos can be dynamically and depends on the roles an image has to be related.
For example, when only one image with the role base
should be imported, it’s enough to have the columns base_image
.
The columns base_image_label
and base_image_position
are optional.
For each additional role, an image has to be related to, the additional columns are necessary, either it is the same image or not.
Column Name | Type | Example | Description |
---|---|---|---|
<role>_image |
|
|
The relative path to the image, starting with a slash (/). |
<role>_image_label |
|
|
The image label used as alt text. |
<role>_image_position |
|
|
The position the image should be rendered in the admin backend and frontend. |
additional_images |
|
|
This column must contain a comma (,) separated list of relative paths to images. |
additional_image_labels |
|
|
This column must contain a comma (,) separated list of alt texts for the images in the
column |
additional_image_positions |
|
|
This column must contain a comma (,) separated list positions for the images in the
column |
<role>_video |
|
The URL to the video should be loaded, by default, only videos from YouTube (needs an API key) or Vimeo are supported. |
|
<role>_video_title |
|
|
The title will be displayed on top of the video on the product detail page when the user hovers over the video. |
<role>_video_description |
|
|
A description of the video which will be visible in the admin backend only. |
<role>_video_provider |
|
|
The name of the video provider, is either |
<role>_video_metadata |
text |
|
Additional metadata for the video that will be visible in the Admin backend only. |
additional_videos |
|
This column must contain a comma (,) separated list of URLs to additional videos that should be loaded. |
|
additional_video_titles |
|
|
This column must contain a comma (,) separated list of titles for the videos in the column The title will be displayed above the video on the product detail page if a user hovers over the video. |
additional_video_descriptions |
|
|
This column must contain a comma (,) separated list of descriptions for the videos in the column The descriptions will be visible in the admin backend only. |
additional_video_providers |
|
|
This column must contain a comma (,) separated list of provides for the videos in the column |
additional_video_metadata |
|
|
This column must contain a comma (,) separated list of metadata for the videos in the column The metadata will be visible in the admin backend only. |
hide_from_product_page |
|
|
Contains a comma (,) separated list of the relative image paths that should not be rendered on the product detail page, whereas it doesn’t matter if it is an image with a role or one of the additional images |
disabled_images |
|
|
Contains a comma (,) separated list of the relative image paths that should not be rendered anywhere, whereas it doesn’t matter if it is an image with a role or one of the additional images |
If you currently want to import videos to the Here is a small example: Column Column During the import process, when the If the pictures in the column So the preview images of the videos must be in the Otherwise, the assignment does not work. The order in the Otherwise, the transfer will not work. The actual order for the display in Admin backend and frontend can then be imported accordingly using the
|
Dedicated media import
Besides the possibility of importing videos, like images, with the product import itself, the Pacemaker Professional Edition (PE) comes with a command that allows a dedicated import of media files, including pictures and videos.
To give you a better idea, we have a repository with sample data that contains a CSV file that only includes the necessary columns for a dedicated media import.
To run a dedicated media import and import a video for the product with the SKU 24-MB01
, it is necessary
to configure the YouTube API first, before the following c
ommand can be invoked.
cd <magento-install-dir> \
&& rm var/pacemaker/import/*.csv \
&& cp <sample-data-pro-dir>/* var/pacemaker/import \
&& vendor/bin/pacemaker import:products:media add-update \
--clear-artefacts=false \
--archive-artefacts=false \
--serial=import \
--source-dir=var/pacemaker \
--target-dir=var/pacemaker
After refreshing the indexes, the video should be visible on the product detail page on the frontend and in the admin backend.