Hello.

There is an object_id. You need to somehow get the id of the corresponding page.

Example:

<udata generation-time="0.114856"> <page id="11" parentId="0" link="/articles/novaya_stranica_kontenta/" is-active="1" object-id="27146" type-id="10" update-time="1254299905" alt-name="novaya_stranica_kontenta"> <basetype id="2" module="content" method="">Страницы контента</basetype> <name>Новая страница контента</name> <properties> <group id="3183" name="svojstva_publikacii"> <title>Свойства публикации</title> <property id="9029" name="publish_status" type="relation"> <title>Авторы</title> <value> <item id="27085" name="Лавров Максим" type-id="745" ownerId="14" xlink:href="uobject://27085"/> </value> </property> </group> </properties> </page> </udata> 

Here in property = 9029 there is a list of authors of the article, the authors are represented by separate pages.
On the article page there is a drop-down list with the authors.

The essence of the problem:
In the XSLT template at the time of processing the article template, in the authors 'block, you need to put links to the authors' pages. But since they are presented as a uobject, and not an upage, respectively, it is not possible to get links to their pages.

How can this be circumvented?
Thank.

    1 answer 1

    I bring the decision on the basis of the custom macro using API. In /classes/modules/custom.php or /classes/components/custom.php insert the function:

     function getPageByObjectId($iObjectID) { $hierarchy = umiHierarchy::getInstance(); $aPages = $hierarchy->getObjectInstances($iObjectID); return isset($aPages[0]) ? ['page' => $hierarchy->getElement($aPages[0])] : ''; } 

    In the xslt-template, you can get a link if it has this line:

     <xsl:value-of select="document(concat('/udata:/custom/getPageByObjectId/',$objectId))/udata/page/@link" />