Excel Smart Documents

Supports Templates in MS Excel that are rendered as Smart Documents.

Installation

Follow the general installation instructions to install the alani and alanioffice modules.

Make sure that BS Office is activated in the license settings.

 

If you need support for installation please contact bs@contentserv.com

Getting started

A simple Template could look like this:

Attribute IDs or Technical Attribute Names are placed between two dollar signs and will be dynamically replaced with the content from the PIM or MAM. Other content in the template will remain in the generated document.

We upload this template file to the MAM.

Then we create a new Smart Document Preset. The type of the preset should be Excel. We can also select a sample product that we can use to test the template.

Next, we select the template file in the Template Options.

If we render the document, it might look like this:

Label, price, and image have been inserted at the top of the document. Below that, a Flex Table with 4 columns was added.

Configuration Options

Since some of the content does not fit into the cells we can adjust the column width to fit with the content.

We can also display the price with the currency. Note: This will cause the content to be inserted as text.

We change the appearance of the images by:

  • Setting the height to 200

  • Selecting a media preset (this one will change the color space of the images to grey)

Furthermore, we change the context selection to add one Worksheet for every child of the selected context.

[Note: We have changed the three options at the bottom here]

Image Placeholders

You can use an image as a placeholder in a template and define the image attribute in its alt text. The image will then be dynamically replaced by the referenced image.

Adjusting the cell size to the size of the inserted images

In the settings, you can define if the cell size should be adjusted so that it has the same size as the inserted images. If you are using templates with a fixed layout where cell sizes must not change you can switch this option off.

Flex Tables

Next, we want to have a brief look at the appearance of Flex Tables. To illustrate this we simplify the template file:

To visualize what styles we got from the Flex Table we select “Highlight Unknown Styles“ in the settings.

The generated document reveals that we have been using an empty style template.

We add the highlighted style names to the style template. The document with the styles could look like this:

We upload the style template to the MAM and select it in the configuration.

If we now generate a fresh document we can see the styles applied to the individual table cells:

Preset Placeholders

Preset placeholders are placed between two question marks.

They appear in the preset settings. When the document is generated they will be replaced by the content defined in the “Dynamic Preset Fields“ configuration.

[Note: If you want the styles from the template to remain in the document don’t use the Richtext Option]

Important:
Because we don’t want the preset placeholder to be overwritten by the Flex Table above it, we also check the “Insert Rows for Flex Tables“ option.

Content depending on other Content

You can make a row dependent on whether an attribute in the PIM/DAM has a value.

To do that you can write {{dr: ATTRIBUTE_IDENTIFIER}} anywhere in that row. If that attribute does not have a value the entire row will be removed. Otherwise, {{dr: ATTRIBUTE_IDENTIFIER}} will be removed from the document.

This feature might, for instance, be used for a heading that should only be displayed if the content following it actually has a value.

Last Words

If you want to try Smart Excel Documents 'hands-on', please contact bs@contentserv.com

Features under development & Bugs

  • Integration to channels/views (currently there is a problem with the FlexTable API that causes an Error if FlexTables are used in Channels). There is a workaround that involved changing one line of code in the admin that can be applied until the bug is fixed by the Core Dev team.