Scandal
Well-known member
Well, on Node repository, there is the following method which return the $finder for the forums which will be displayed on forum home page.
Let's say that I have the following structure that's returned by the above method:
My question: what do I have to apply to the $finder so the result on the forum list to be:
- Category 2
-- Sub7
-- Sub8
--- Sub9
-- Sub10
?
Let's say that the Category 2 has node_id = X.
I tried ->where('parent_node_id', X) but this was not returned something.
PHP:
public function findNodesForList(\XF\Entity\Node $withinNode = null)
{
/** @var \XF\Finder\Node $finder */
$finder = $this->finder('XF:Node');
if ($withinNode)
{
$finder->descendantOf($withinNode);
}
$finder->listable()
->setDefaultOrder('lft');
return $finder;
}
- Category 1
-- Sub1
-- Sub2
-- Sub3
--- Sub4
--- Sub5
-- Sub6
- Category 2
-- Sub7
-- Sub8
--- Sub9
-- Sub10
- Category 3
-- Sub11
-- Sub12
My question: what do I have to apply to the $finder so the result on the forum list to be:
- Category 2
-- Sub7
-- Sub8
--- Sub9
-- Sub10
?
Let's say that the Category 2 has node_id = X.
I tried ->where('parent_node_id', X) but this was not returned something.