© Copyright Excosoft. Powered by Skribenta CCMS® and Topic Finder CDP®

Find and navigate

Filters


Add/remove/view favorites


Table of contents

File properties

Defining a variable in the configuration file

Background

The procedure in this topic assumes Skribenta is installed and configured for normal operation, and:

You need to replace content in your content file with a general purpose variable, or you need to conditionalize content using variables.

It is possible to replace content in a file with a general purpose variable, or to conditionalize content using variables. The variables need to be defined in the publication's configuration file.

The variables can be of different types:

Variable type

Variable value

Block

One or several block elements, for example a table, include or wrapper element.

Boolean

A boolean value:

  • true

  • false

Double

A decimal number.

FLEXConfig

Flexible values depending on the publishing language. In the example below, the value is "456" when publishing to British English (en), "789" when publishing to Swedish (sv) and "123" when publishing to all other languages (default).

Name

Type

Value

default

String

123

en

String

456

sv

String

789

Integer

A whole number (no decimals).

Link

A link element, which is resolved in the content file as the resource ID of the link target file. This variable type is mostly used in stylesheet files.

String

A paragraph element which content shall not be translated.

String[]

An array of strings in separate paragraph elements. This variable type is mostly used in stylesheet files.

TranString

A paragraph element which content shall be translated.

About this task

This instruction tells you how to define variables in a configuration file.

This is an example of content in a configuration file before defining a variable.

This is an example of content in a configuration file after defining a variable.

In the shown images, the XML tags are visible. To show XML tags, see Turning XML element tags on or off.

Open your configuration file, then type the variable's name, type and value in the corresponding columns in the Variables table.

1 - 5 minutes

Procedure

In the shown images, the XML tags are visible. To show XML tags, see Turning XML element tags on or off.

1. Make sure that the step(s) in section "Starting point" (see section "Background" above) are performed.

The configuration file content opens.

The Variables table is displayed.

If there is no Variables table, you need to create one or copy one from another configuration file.

  • type the variable type,

    or

  • start typing and click the arrow to select type from the list.

8. To define another variable, create a new table row and repeat the above procedure from step 4.