Text Template Bundle

Developed by Mitting UG (hbs.)
Akeneo Community Partner
Akeneo PIM compatibility
Enterprise Edition (SaaS) Not supported
Enterprise Edition (PaaS)
Growth Edition Not supported
Community Edition
Extension type
More info
Extension version
Price: €750.00



Do you use texts like the following in your product descriptions?

The HP HD 5210 is a Skype®-certified autofocus HD webcam that is available since September 19, 2011. It provides up to 1920 x 1080 widescreen streams at a frame rate of 30.

The above example contains four attributes that are part of the default Akeneo demo data:

  • Product name
  • Release date
  • Maximum video resolution
  • Maximum frame rate

Now guess what happens when you or a co-worker updates the frame rate attribute from 30 to 60?! Correct, the description would not reflect this change until you edit the text by hand. We all are humans and it's easy to forget to update the related texts for all scopes and locales after such a change.

Wouldn't it be nice if you could reference the different attributes directly in the description? That's exactly what this extension provides.


  • Adds two new attribute types ("Twig Text" and "Twig Text Area") where you can define templates referencing any attribute value of the current product
  • Provides auto-completion for your attribute codes and custom filters
  • Works with and without WYSIWYG enabled
  • Supports "value per channel" and "value per locale" attributes
  • Supports reference data objects
  • Supports product models
  • Supports assigned categories and associations
  • Use provided Twig filters to format metrics, dates, currencies etc. or simply add your own
  • Use the product REST API or the default CSV/XLSX exports to access the rendered texts for your online shop etc.

Are you interested? Feel free to contact us.

Release notes

Release notes

Currently, this extension supports Akeneo 2.3, 3.x, 4.0, 5.0 and 6.0.



After purchasing this bundle, you'll get access to the private Git repository. We also assume that you are running Akeneo via Docker. If this is not the case, you can simply derive the installation steps.


After adding the repositories configuration to your composer.json file, run composer to install the files:

docker-compose run -u www-data --rm php php -d memory_limit=4G /usr/local/bin/composer require mitting/akeneo-text-template-bundle v6.0.x-dev

Activate the bundle

Add the following to the array in config/bundles.php:

Mitting\Bundle\AkeneoTextTemplateBundle\MittingAkeneoTextTemplateBundle::class => ['dev' => true, 'test' => true, 'prod' => true],

Add the routing configuration to config/routes/mitting_akeneo_text_template.yml:

    resource: "@MittingAkeneoTextTemplateBundle/Resources/config/routing.yml"

Clear the cache:

docker-compose run -u www-data --rm php rm -rf var/cache
docker-compose run -u www-data --rm php php bin/console cache:warmup

Create a job to update products when changing the default value of an attribute:

docker-compose run -u www-data --rm php bin/console akeneo:batch:create-job 'Mitting Text Template Bundle Connector' render_twig_default_value_attributes mitting_text_template render_twig_default_value_attributes

Then run

make upgrade-front

to finish the installation.


The bundle adds the "Twig Text" and "Twig Text Area" attribute types. Simply create new attributes of the given types and optionally define a default template. Now you can write twig markup to print out your attribute in any format you like.

Template snippets

Slug including categories

Create a slug based on assigned categories and SKU.

{{ categories | merge([name, sku]) | join(' ') | slugify }}

Metric attribute

This example shows how the localizedmetric-filter prints out the value suffixed by the translated metric unit.

Weight: {{ weight | localizedmetric }}
Weight: 512 Gram

Calculate a value based on two metric attributes:

Productiveness: {{(v.amount / a.amount)|number_format}} {{v.symbol}}/{{a.symbol}}
Productiveness: 1.5 l/m²

Price attribute

The localizedprice-filter is based on the localizedcurrency-filter and makes it easy to print the given currency.

Price: {{price | localizedprice('EUR') }}
Price: €100.00

Date attribute

Twig already provides the localizeddate-filter. Here you can see how to use the locale-variable, which is automatically available.

Date: {{ date | localizeddate('medium', 'none', locale) }}
Date: Sep 19, 2011

Number attribute

Use the localizednumber-filter to format any numbers.

Number: {{ number | localizednumber('decimal', 'default', locale) }}
Number: 1.250.000

Boolean attribute

The if-statement lets you output any text.

Available: {% if available %}yes{% else %}no{% endif %}
Available: yes

Simple select attribute

Printing the localized value of a select attribute can be achieved by using the localized-filter.

Color: {{ color | localized }}
Color: Grey

Multi select attribute

Like in the previous simple select snipped, you can use the localized-filter to output multiple values, separated by comma.

Colors: {{ colors | localized }}
Colors: Grey, Red, Blue

Reference data attribute

You can output the result of __toString() like any other scalar attribute.

Color: {{ color_reference }}
Color: Red

Reference data attribute property

It's also possible, to output properties of a reference data object.

Hex-Code: {{ color_reference.hex }}
Hex-Code: #ff0000

Reference data attribute property translation

If your reference data object implements the TranslatableInterface interface, you can directly output the translation.

Pictogram: {{ pictogram.translation.label }}
Pictogram: flameable

Reference data attribute twig filter

Of cause you can register your own twig filters to output anything you want.

{{ color_reference | format_color }}
The hex-code of the color "Red" is #ff0000

Are you missing a feature?

There are plenty of possibilities. Feel free to ask us your questions.