Get Topic Display order value [solved]

Permalink
I'm trying to get the display order from a topic tree for sorting a pagelist in order.

Its similar to below (that one uses a select attribute):
https://www.concrete5.org/community/forums/customizing_c5/page-list-...

foreach($pages as $k=>$v) {
        $price = $v->getAttribute('price');
        //print_r($price);
        $sort['price'][$k] = ...?... ;
    }
    array_multisort($sort['price'], SORT_ASC, $pages);


Result (one topic):
Array ( [0] => Concrete\Core\Tree\Node\Type\Topic Object ( [childNodes:protected] => Array ( ) [childNodesLoaded:protected] => [treeNodeIsSelected:protected] => [tree:protected] => [error] => [treeNodeID] => 12 [treeNodeTypeID] => 3 [treeID] => 3 [treeNodeParentID] => 9 [treeNodeDisplayOrder] => 2 [treeNodeOverridePermissions] => 0 [inheritPermissionsFromTreeNodeID] => 9 [treeNodeTopicName] => Bronze ) )
[/code]

How do I get the 'treeNodeDisplayOrder' from this.

Solution:
$sort['price'][$k] = $price[0]->treeNodeDisplayOrder;


Concrete v5.7.5.13

c5dragon