iphlex systems text blocks
iphlexwebphlexdocumentation > text blocks
show contents
hide contents

 

top of page
what is a text block?

A text block can be a single word or symbol, or any text up to 65,536 characters long.

It can exist in a single version or in different versions for different languages.

It can be referenced by a user-defined code or a unique number, and used anywhere in the system where text would normally be entered; it will be replaced, where appropriate, by the actual contents of the text block in the language currently being used.

see also:

top of page
advantages of using text blocks

Using a text block offers several advantages over the use of a normal text field:

  • the text can exist in several languages, and the correct version will be retrieved automatically by the system according to the language being used,
  • a text can be maintained in one place (via the text block screen) but used in many places,
  • a text block can always contain up to 65,536 characters, whereas a normal text field is often limited to 255 characters or less.
top of page
using a text block to replace a field

Throughout the system, many fields capable of holding text can also be replaced by a text block. These can be recognised by the presence of a small numeric field with a pull-down button, usually near the lower right corner of the field.

Text directly entered into the field exists in only one version, i.e. the version which is visible on the screen:


(image_0011)

 

 

If a text block number is entered into the text block number field, then whenever the main field is used, the contents of the text block will be retrieved instead of the actual field contents. To indicate this, the main field contents are replaced on the screen with the contents of the text block, if possible in the language currently in use:


(image_0012)

 

The background colour of the main field changes, and the field contents can no longer be directly changed.

To work on the text block contents, the text block screen can be called up by double-clicking in the text block number field.

see also:

top of page
converting a normal text field into a text block

If the main field is filled and the text block number field empty, double-clicking in the text block number field will invoke the option of converting the main field into a text block. After confirmation, a new text block will be created containing the contents of the main field (assumed to be in the page group's default language), and its number will be entered into the text block number field.

It is also possible to convert all of a page group's fields into text blocks using the button 'convert texts to text blocks' (control panel > web pages > web page groups > advanced). In this way a web site designed in one language can easily be converted into a multi-language site.

top of page
'embedded' text blocks

As well as being used to replace the entire contents of a field, a text block can also be 'embedded' in the contents of a text field (or another text block), using a replacement code containing its code or number. When the field is used, the replacement code will then be replaced by the contents of the text block in the correct language.
 
E.g. to use the text from the text block with code "*pageLastUpd" (number -102), use code #TEXT:*pageLastUpd#
or #TEXT:-102#:

  text block "*pageLastUpd" #TEXT:*pageLastUpd# Page last updated:
 
Text blocks can include local and system-wide replacement codes:

e.g.  text block "*page n / x" #TEXT:*page n / x# Page #PAGE_NUMBER# / #NUMBER_OF_PAGES#
page 1 / 1
 
Text blocks can even include other text blocks:

e.g.  text block "*pageLastUpd:DATE#" #TEXT:*pageLastUpd:DATE# #TEXT:*pageLastUpd# #DATE_LAST_UPD#
Page last updated: 13-09-2004

In replacement codes of this type, a numeric value is interpreted as a key number and a non-numeric value as a code. However, a code which happens to be completely numeric can be used by putting it between quotes.

see also:

top of page
what is the best way to use text blocks?

As shown above, a text block can be used to replace the entire contents of a field, or it can be embedded inside the field's content. In many situations the same effect can be achieved using either method, but they both have their advantages and disadvantages:

When a text block replaces the entire contents of a field, its number is stored in the field's record. This means that

  • the record will appear in the 'used in' lists in the text block screen, so that it can be very quickly and easily found and accessed,
  • the text block can quickly be called up and worked on by double-clicking in the text block number field,
  • it is also very easy to replace a given text block with another one throughout the system (in the 'replace' section of the text block screen or in the 'text blocks' section of the global find and change screen),
  • it is not possible to delete the text block while it is in use in this way, which makes this the safer of the two methods.

By embedding text blocks in a field's content, the field can be built up of two or more text blocks, or a combination of fixed text (i.e. text which is the same for all languages, e.g. HTML tags and replacement codes) and language-dependant texts. As a text block can itself contain other text blocks, it is possible to build an efficient system for retrieving texts in a multi-language environment.

  • the record will NOT appear in the 'used in' lists in the text block screen; however, it can still be found and changed using the global find and change screen,
  • it is possible to replace an embedded text block with another one throughout the system (in the 'replace' section of the text block screen or in the 'text blocks' section of the global find and change screen), but this can take considerably longer than for a text block replacing an entire field,
  • it IS possible to delete a text block while it is still in use in this way; a warning will be given when the field in question is used, and the replacement code will not be replaced.
top of page
types of text blocks

A text block can be assigned a 'type' indication (at control panel > texts and documents > text blocks > general), e.g.

  • normal text (the default),
  • page template,
  • element template,
  • template for navigation lists (page, element, site and language navigation),
  • template for previous/next navigation (the first, next, previous and last navigation blocks for pages and elements).
The only effect of giving a text block a type other than normal text is that it can easily be selected in relevant pull-down buttons for templates when the 'show all text blocks' indicator is not set. Having this indicator set makes the selection lists much shorter and selecting the right template that much easier.

Apart from that all text blocks are equal and you can use any text block in any situation.

see also:

top of page
the OK? indicator

Each language version of a text block has an OK? indicator (control panel > texts and documents > text blocks > general), which is used in translation management.

When a text is changed in one language, the OK? indicators of all other language versions are automatically turned off, the idea being they will be manually turned on again when these translated versions have been checked and corrected if necessary.

A user who is allowed to change any language can turn the OK? indicators of all language versions on or off simultaneously using the indicator at the top of the text block screen. A user who is only allowed to change texts in one language can only set the indicator for that language.

As the OK? indicator can be used as a selection criterion in the screen 'perform an action' (control panel > actions > perform an action), it is easy, for instance, to work on all texts for which the versions in one particular language have recently been changed.

see also:

top of page
main text & short text

Each text block actually consists of two texts in each language, a main text and a short text:

  • The main text is the text normally retrieved when the text block is used, e.g. in the case of a template, the main text is the actual template.
  • The short text is generally used to identify and describe the text block, and to find it using the search and global find screens. In the case of a template, for instance, the short text could contain a description of where and how the template is used.
It is, however, possible to retrieve the short text instead of the main text, by using the parameter SHORT in the replacement code. In this way the short text can be used, for instance, as a paragraph heading, with the actual paragraph contents in the main text, both of them being retrieved during page generation (this technique is used in the example web site *belgium).

see also:

top of page
hidden text blocks

Text blocks with the "hidden?" indicator set on will not be found in the global find screen and will not be included in actions. They are also not shown in the text block and search screens unless the indicator "show hidden text blocks?" is set on. All the help texts, for example, are actually hidden text blocks.

see also:

 

Tip: you can search for a text in the help system by opening the text blocks screen (control panel > texts and documents > text blocks), clicking the search buttonclick for more information about this button ), setting "show hidden text blocks?" on, and searching for the text. Double-clicking on a line in the results window will call up the text block, and on the page "used in help item" in the text block screen you can see any help items which use the text. Double-clicking on one of them will call up the help message.

see also:

top of page
iphlexwebphlexdocumentation > text blocks Copyright © 2006 iphlex systems