Content block processing

More often than not, the very self structure of a document needs to be modified upon the data it may hold.

Think, for example, of a document table with an a priori undefined number of rows like it is usually the case of invoices; or otherwise a section of a contract or legal document that only applies under certain conditions that can not be foreseen beforehand before knowing the end user input.

Docxpresso is designed to graciously handle those situations.

Docxpresso takes into account three different kinds of content blocks:

  • Tables: any table row that contains a variable may in principle be cloned.
  • Lists: any list item that contains a variable may also in principle be cloned.
  • Bookmarked content: any piece of bookmarked content that contains a variable may also in principle be cloned.

Moreover, we may set any of these different types of content to be shown or hidden depending on the value of a variable within the very same document.

Let us go over the nitty-gritty details.

Content block configuration

Whenever hovering the mouse over an active content block a button will show up in the upper left corner of the content block. By clicking it a pop-up window will show up with the following options:

  • Clonable: check it (default value) if you want the variable block to be replicated by the end user. If you have used, for example, a table for formatting you may safely uncheck it and the end user will not be able to clone it.
  • Display: you may choose via the radio button if you want this content block to be shown by default or not (the default value is "Show").
  • Toggle visibility: you may choose to toggle visibility depending on one or multiple values of a given variable (that must be of a closed set of options):
    • Variable: variable on which the visibility of the content block depends.
    • Value: semicolon separated list of values that will toggle the default display settings.

Advanced topics

Cloning of table rows may show tricky whenever the structure of the table is not plain, i.e. there are column and row spans.

Docxpresso usually makes a reasonable guess of the potential replicable structure because, in principle, the replicable rows may be composed by more than a single one. Nevertheless, if Docxpresso choice is not the one expected, the best option is to edit the original document and group adequately the cloneable set of rows. Here you have an example with the following table:

name data
{{product}} {{item}}
{{value}}
Last row Random content

Docxpresso will naturally make cloneable the two central rows as may be naturally expected, but if we use this table instead:

name data
{{product}} {{item}}
Other content
{{value}}
Last row Random content

Docxpresso will "get confused" and group the rows with variables moving downwards the new row with plain content.

A possible way out is to simply replace the table by:

name data
{{product}} {{item}}
Other {{content}}
{{value}}
Last row Random content

And set the variable {{content}} as global and non-editable in the variable processing interface. This way, Docxpresso will group all three rows as cloneable and the user will not be able to detect any editable content in the middle row as desired.