Introduction

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.Sample product description

The above example contains four attributes that are part of the default Akeneo demo data:
Product name, Release date, Maximum video resolution and 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.

Features

  • Enhances the text area attribute type so that you can insert any attribute value into the text
  • Provides auto-completion for your attribute codes
  • Works with and without WYSIWYG enabled
  • Supports "value per channel" and "value per locale" attributes
  • Supports reference data objects
  • Supports product models
  • 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.

Template snippets

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

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 by using the form below.

Screenshots

Attribute form
Product edit
Product edit autocomplete

Contact

Got interested? Fill out the form to send us a message, request a demo or ask your questions.

Text Template Bundle

This Akeneo extension allows you to use the values of your product attributes inside any text area attribute. This way you can easily compose rich texts with dynamic contents that stay in sync with your data.