Multilingual DBListManager Displayer

Modifié par Admin ATILLA le 2026/02/02 09:20

Description

Help you to display a field managed by MLDBListManager.

Usage

Instead of writing:
$doc.getObject('MySpace.MyClass').display('myProperty')

You can write:
{{mldblist_display property='myProperty' objClass='MySpace.MyClass' objNumber="$doc.getObject('MySpace.MyClass').getNumber()" /}}

Options are:

  • "property" is the name of the field to display
  • "objClass" is the class of the object to display
  • "objNumber" is the number of the object to display
  • "objDoc" is the document that contains the object to display (default: current document)
  • "mode" is the mode of the rendering (could be 'view' or 'edit', default: the current edition mode)
  • "fieldName is the name of the input field (only when the mode is 'edit', default: something like MySpace.MyClass_0_myProperty)

Examples of use

The '$obj.display()' equivalent

#set($obj = $doc.getObject('Test.NewClass'))
{{mldblist_display objNumber="$obj.getNumber()" objClass="Test.NewClass" property="test" /}}

The '$obj.get()' equivalent

#set($obj = $doc.getObject('Test.NewClass'))
{{mldblist_display objNumber="$obj.getNumber()" objClass="Test.NewClass" property="test" mode="view"/}}

An object of an other document

#set($document = $xwiki.getDocument('MyTest.MyDatas'))
#set($obj = $document.getObject('Test.NewClass'))
{{mldblist_display objNumber="$obj.getNumber()" objClass="Test.NewClass" property="test" objDoc='MyTest.MyDatas'/}}

Credits

  • Guillaume Delhumeau (XWiki SAS).