Contao:前端 - 获取另一个页面的主题部分 - 不是当前页面


Contao: Frontend - Get theme section of another page - not the current page

我需要通过页面ID(或PageModel Object)访问自定义部分,但我找不到获取FrontendTemplate的方法。我想在下拉导航中使用它来回显悬停(父)页面的自定义部分。

如果有人会搜索,答案是:

<?php
    $articles = 'ArticleModel::findPublishedByPidAndColumn($id, $column_name);
    echo static::getArticle($articles[0]); // for ex. the first article
?>