Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
サイドバーにノード $links を印刷するにはどうすればよいですか? node.tpl.php の外部からそれらを取得して出力するには、どの関数を呼び出すことができますか? 私はまだノードにいます。また、パネルを使用することはできません。
template_preprocess_node関数から:
template_preprocess_node
$variables['links'] = !empty($node->links) ? theme('links', $node->links, array('class' => 'links inline')) : '';
ユースケースに合わせてテーマ関数を少し変更したい場合があります。これが他のモジュールでどのように機能するかはテストしていませんが、代わりにノード オブジェクトを使用してリンクを追加する場合は問題ありません。