Let XLinks Show the Parent Links on Non-Folder Items

Release 1.0 - ...

The XLinks macro has an implicit default for the parent property, set to the current item. If the current item is not a folder however, the list will remain empty.

With this easy trick, the parent property will be set to the containing folder in that case:

Smartsite SXML CopyCode image Copy Code
<se:xlinks parent="{sys.iif(itemdata.isfolder(), itemdata.number(), itemdata.parent())}" />

The example uses the ternary method sys.iif() to evaluate the correct parent.