Introduction
The Akeneo PIM (Product Information Management) system provides a customizable and extensible platform for managing product data. One of the customization options available is the ability to add a new tab to the Akeneo side menubar. In this blog post, we will walk you through the steps to create a new tab and integrate it seamlessly into the Akeneo interface.
Prerequisites
Before we begin, make sure you have the following prerequisites:
- Access to the Akeneo project directory
- Familiarity with PHP and Symfony framework
- Basic understanding of Akeneo’s architecture
Step 1: Create a New Bundle
To start, we need to create a new bundle for our custom functionality. Follow these steps:
- Locate the Akeneo project directory on your server.
- Open a terminal and navigate to the `
src` directory within your Akeneo project. - Create a new directory for your custom bundle. Let’s name it `
CustomBundle`. - Inside the `
CustomBundle` directory, create the necessary files and folders according to Symfony’s bundle structure.
Here’s an example of the directory structure for your custom bundle:
src/
CustomBundle/
Controller/
CustomController.php
Resources/
views/
index.html.twig
CustomBundle.php
Step 2: Configure the Bundle
Next, we need to configure the newly created bundle. Here’s what you need to do:
- Open the `
CustomBundle.php` file located inside the `CustomBundle` directory. - Define the namespace and extend the `
Bundle` class. - Implement the necessary methods required by the `
Bundle` class.
Here’s an example of the CustomBundle.php file:
// src/CustomBundle/CustomBundle.php
namespace CustomBundle;
use Symfony\Component\HttpKernel\Bundle\Bundle;
class CustomBundle extends Bundle
{
}
Step 3: Create the Controller
In this step, we’ll create a controller that will handle the logic for the new tab. Follow these steps:
- Inside the
Controllerdirectory of yourCustomBundle, create a new file, e.g.,CustomController.php. - Define the namespace and extend the
AbstractControllerclass from Symfony. - Implement the action method that will be responsible for rendering the content of your new tab.
Here’s an example of the CustomController.php file:
// src/CustomBundle/Controller/CustomController.php
namespace CustomBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Response;
class CustomController extends AbstractController
{
public function index(): Response
{
return $this->render('@Custom/views/index.html.twig');
}
}
Step 4: Create the Template
To display the content of the new tab, we’ll create a template file. Follow these steps:
- Inside the
Resourcesdirectory of yourCustomBundle, create a new directory namedviews. - Inside the
viewsdirectory, create a new file, e.g.,index.html.twig. - Define the necessary HTML structure and content for your new tab using Twig syntax.
Here’s an example of the index.html.twig file:
{# src/CustomBundle/Resources/views/index.html.twig #}
{% extends '@Akeneo/layout.html.twig' %}
{% block content %}
<h1>New Tab</h1>
<p>This is the content of the new tab.</p>
<code>//
Step 5: Clear the Cache
To ensure that your changes take effect, we need to clear the cache. Run the following command in the terminal:
php bin/console cache:clear

Now you can see Akeneo side menubar in the above image.

Be the first to comment.