entelechy
Active member
I'm learning XF at the moment, and looking at creating custom pages. In order to be able to edit the layout of one forum node, I've added an conditional statement in the Forum controller at the end of actionForum(), changing "return $this->view('XF:Forum\View', 'forum_view', $viewParams);" to:
if ($params->node_id == 36) {
return $this->view('XF:Forum\View', 'forum_view_alternative', $viewParams);
} else {
return $this->view('XF:Forum\View', 'forum_view', $viewParams);
}
The 'forum_view' template is still being generated when I visit this node however, instead of the desired 'forum_view_alternative' template. Should I be going about it this way, or am I going to need to build a separate route and controller for the forum nodes that I want to modify?
if ($params->node_id == 36) {
return $this->view('XF:Forum\View', 'forum_view_alternative', $viewParams);
} else {
return $this->view('XF:Forum\View', 'forum_view', $viewParams);
}
The 'forum_view' template is still being generated when I visit this node however, instead of the desired 'forum_view_alternative' template. Should I be going about it this way, or am I going to need to build a separate route and controller for the forum nodes that I want to modify?
Last edited: