Akeneo URL Media Attribute || Akeneo Image URL

Kavita Singh
Published: July 28, 2022

Akeneo URL Media Attribute: The “URL media attribute” attribute type can be created in this module and used as a new attribute type in products in Akeneo.

Users are able to upload public media/file URLs and even view a preview of the media file for the URL. The user will benefit from this functionality by having less storage space required.

Basic Requirements

  • This module works with Akeneo, Akeneo 5.0.x. Download Akeneo from here
  • Node and Yarn packages need to be installed.
  • Also works with Akeneo Cloud Flexibility Mode which is a PAAS Edition of Akeneo

Feature

  • You can upload the URL for the public file or media.
  • Using this module you can preview the media.
  • Users can download the media/file.
  • You can create the Localizable and Scopable URL media attribute in this module.
  • In the product grid filter, you can use the attribute.
  • By using the CSV/XLSX and Akeneo API, users can upload media.

Composer Installation

Read This Blog

Before beginning the composer installation

1: Get the ACCESS KEYS [Create a support ticket]
2: In Akeneo composer.json, add our repository as well as the installation script.

Searching for an experienced
Akeneo Company ?
Read More


For Akeneo <=5.x 

{
  "scripts": {
        "post-update-cmd": [
           
"vendor/webkul/urlmediabundle/composer_install.sh"
        ],
        "post-install-cmd": [
           
"vendor/webkul/urlmediabundle/composer_install.sh"
        ],
        "post-create-project-cmd": [
         
"vendor/webkul/urlmediabundle/composer_install.sh"
       ]
   },
  "repositories": [{
    "type": "composer",
    "url": "https://akeneorepo.webkul.com/"
  }]
}

3: Use composer to install the extension.

         composer require webkul/urlmediabundle

4: Complete the authentication form.
5: Send a Message of Success
6: Delete your browser’s cache.

Installing Module for Version 4.0.x to 5.0.x

For installing this module in Akeneo, please follow the further steps:

1 – Unzip the respective extension zip then merge the “src” folder into the akeneo project root directory.

src-2-

2 – Goto config/Bundles.php then add the line:

Webkul\UrlMediaBundle\UrlMediaBundle::class => ['all' => true],

in the return array.

For = Akeneo 5

  • copy the “config” folder into Akeneo project root directory for routing.
  • Run the Elasticsearch command after installation
php bin/console akeneo:elasticsearch:reset-indexes --env=prod && php bin/console pim:product:index --all --env=prod && php bin/console pim:product-model:index --all --env=prod

For = Akeneo 4

Note: No Need to add the service folder

  • copy the “config/routes” folder into the Akeneo project root directory for routing.
con

3 – Run this command after ssh to your akeneo server by terminal and navigating to pim installation directory (don’t run this command directly after ssh, first navigate to pim installation directory using cd command ex. cd /opt/bitnami/apps/akeneo/htdocs)

For non-docker instance:

rm -rf var/cache && php bin/console ca:warmup && php bin/console urlmedia:setup:install

For docker instance:

For >=Akeneo 5

    alias docker_php='docker-compose run -u www-data --rm php php';
    alias docker_yarn='docker-compose run -u node --rm node yarn';
    docker_php bin/console cache:clear --env=prod;
    docker_php bin/console pim:installer:assets --symlink --clean --env=prod;
    docker_php bin/console d:s:u --force;
    docker_yarn run webpack;
    docker_yarn run update-extensions;
    docker_yarn run less;

For <=Akeneo 4

    alias docker_php='docker-compose run -u www-data --rm php php';
    alias docker_yarn='docker-compose run -u node --rm node yarn';
    docker_php bin/console cache:clear --env=prod;
    docker_php bin/console pim:installer:assets --symlink --clean --env=prod;
    docker_php bin/console d:s:u --force;
    docker_yarn run webpack;
    docker_yarn run less;

Common Issues After Installation

It might happen that even after proper installation, upon opening your Akeneo admin dashboard, you see a loading screen. In that case, do check for the following solution:

error
npm install --save-prod webpack 
npm install

Uninstallation:

After uninstalling the URL Media Attribute Connector then you need to run the below command: (Run the following command after ssh to your akeneo server by terminal)

php bin/console d:q:s "delete from pim_catalog_attribute where attribute_type="pim_catalog_urlmedia""

Create URL Attribute

So, once you have installed the Akeneo URL Media Attribute module, log in to your Akeneo dashboard. Then go to Settings>Attributes.

Attributes-9

After that click on Create Attribute to create new attributes.

Attributes-10

After that click Create Attribute button, and a pop-up window will appear, select the URL Media attribute type.

Attributes-12

In the Properties section, enter any value in Code then select any Attribute Group in which you want to assign this new URL media attribute.

Attributes-Create-1

Enter the table attribute label with translations and click the Save button.

Attributes-Create-1-1

As soon as you click the save button, the attribute will be created and you can edit it to your needs.

Attribute-URL-Media-Usable-in-grid-Edit-2

URL Media Attribute Workflow

You must first assign them to a Family in order to use URL media attributes. the next step is to navigate to Settings>Families>Edit>Add Attributes.

Family-Accessories-Edit

Click the Save button after selecting your new attribute.

Family-Accessories-Edit-1

After that go to Products and create a product with the same family in which you have added the URL media attribute.

Product-Bag-Edit-2

After that click on the link icon to add the link of the product image in the product.

Product-Bag-Edit-3

After clicking on the icon, then you will upload the public media/file URL in the box.

Product-Bag-Edit-4

Once you’re finished, the image will be added to the product as shown in the images. Similarly, you can upload files like pdf and images using this module.

Product-Bag-Edit-6

If you have enabled the URL media attribute for use in the grid then you can check the attribute in the filter section.

Products-16

Support

Thank you for reading this documentation, for any queries or doubts reach out to us at [email protected]. You can also raise a ticket at our HelpDesk System.

Please explore our Akeneo Development Services and Quality Akeneo Extensions.

Current Product Version – 1.0.0

Supported Framework Version – 4.x.x & 5.x.x

Source: webkul.com